AWS Budgets

2017/09/06 - AWS Budgets - 9 updated api methods

Changes  Add an optional "thresholdType" to notifications to support percentage or absolute value thresholds.

CreateBudget (updated) Link ¶
Changes (request)
{'NotificationsWithSubscribers': {'Notification': {'ThresholdType': 'PERCENTAGE '
                                                                    '| '
                                                                    'ABSOLUTE_VALUE'}}}

Create a new budget

See also: AWS API Documentation

Request Syntax

client.create_budget(
    AccountId='string',
    Budget={
        'BudgetName': 'string',
        'BudgetLimit': {
            'Amount': 'string',
            'Unit': 'string'
        },
        'CostFilters': {
            'string': [
                'string',
            ]
        },
        'CostTypes': {
            'IncludeTax': True|False,
            'IncludeSubscription': True|False,
            'UseBlended': True|False
        },
        'TimeUnit': 'DAILY'|'MONTHLY'|'QUARTERLY'|'ANNUALLY',
        'TimePeriod': {
            'Start': datetime(2015, 1, 1),
            'End': datetime(2015, 1, 1)
        },
        'CalculatedSpend': {
            'ActualSpend': {
                'Amount': 'string',
                'Unit': 'string'
            },
            'ForecastedSpend': {
                'Amount': 'string',
                'Unit': 'string'
            }
        },
        'BudgetType': 'USAGE'|'COST'|'RI_UTILIZATION'
    },
    NotificationsWithSubscribers=[
        {
            'Notification': {
                'NotificationType': 'ACTUAL'|'FORECASTED',
                'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
                'Threshold': 123.0,
                'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
            },
            'Subscribers': [
                {
                    'SubscriptionType': 'SNS'|'EMAIL',
                    'Address': 'string'
                },
            ]
        },
    ]
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type Budget

dict

param Budget

[REQUIRED] AWS Budget model

  • BudgetName (string) -- [REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

  • BudgetLimit (dict) -- [REQUIRED] A structure that represents either a cost spend or usage spend. Contains an amount and a unit.

    • Amount (string) -- [REQUIRED] A string to represent NumericValue.

    • Unit (string) -- [REQUIRED] A string to represent budget spend unit. It should be not null and not empty.

  • CostFilters (dict) -- A map that represents the cost filters applied to the budget.

    • (string) -- A generic String.

      • (list) --

        • (string) -- A generic String.

  • CostTypes (dict) -- [REQUIRED] This includes the options for getting the cost of a budget.

    • IncludeTax (boolean) -- [REQUIRED] A generic boolean value.

    • IncludeSubscription (boolean) -- [REQUIRED] A generic boolean value.

    • UseBlended (boolean) -- [REQUIRED] A generic boolean value.

  • TimeUnit (string) -- [REQUIRED] The time unit of the budget. e.g. MONTHLY, QUARTERLY, etc.

  • TimePeriod (dict) -- [REQUIRED] A time period indicating the start date and end date of a budget.

    • Start (datetime) -- [REQUIRED] A generic timestamp. In Java it is transformed to a Date object.

    • End (datetime) -- [REQUIRED] A generic timestamp. In Java it is transformed to a Date object.

  • CalculatedSpend (dict) -- A structure that holds the actual and forecasted spend for a budget.

    • ActualSpend (dict) -- [REQUIRED] A structure that represents either a cost spend or usage spend. Contains an amount and a unit.

      • Amount (string) -- [REQUIRED] A string to represent NumericValue.

      • Unit (string) -- [REQUIRED] A string to represent budget spend unit. It should be not null and not empty.

    • ForecastedSpend (dict) -- A structure that represents either a cost spend or usage spend. Contains an amount and a unit.

      • Amount (string) -- [REQUIRED] A string to represent NumericValue.

      • Unit (string) -- [REQUIRED] A string to represent budget spend unit. It should be not null and not empty.

  • BudgetType (string) -- [REQUIRED] The type of a budget. It should be COST, USAGE, or RI_UTILIZATION.

type NotificationsWithSubscribers

list

param NotificationsWithSubscribers

A list of Notifications, each with a list of subscribers.

  • (dict) -- A structure to relate notification and a list of subscribers who belong to the notification.

    • Notification (dict) -- [REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

      • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

      • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

      • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

      • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

    • Subscribers (list) -- [REQUIRED] A list of subscribers.

      • (dict) -- Subscriber model. Each notification may contain multiple subscribers with different addresses.

        • SubscriptionType (string) -- [REQUIRED] The subscription type of the subscriber. It can be SMS or EMAIL.

        • Address (string) -- [REQUIRED] A generic String.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of CreateBudget

CreateNotification (updated) Link ¶
Changes (request)
{'Notification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Create a new Notification with subscribers for a budget

See also: AWS API Documentation

Request Syntax

client.create_notification(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    },
    Subscribers=[
        {
            'SubscriptionType': 'SNS'|'EMAIL',
            'Address': 'string'
        },
    ]
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type Notification

dict

param Notification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

type Subscribers

list

param Subscribers

[REQUIRED] A list of subscribers.

  • (dict) -- Subscriber model. Each notification may contain multiple subscribers with different addresses.

    • SubscriptionType (string) -- [REQUIRED] The subscription type of the subscriber. It can be SMS or EMAIL.

    • Address (string) -- [REQUIRED] A generic String.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of CreateNotification

CreateSubscriber (updated) Link ¶
Changes (request)
{'Notification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Create a new Subscriber for a notification

See also: AWS API Documentation

Request Syntax

client.create_subscriber(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    },
    Subscriber={
        'SubscriptionType': 'SNS'|'EMAIL',
        'Address': 'string'
    }
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type Notification

dict

param Notification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

type Subscriber

dict

param Subscriber

[REQUIRED] Subscriber model. Each notification may contain multiple subscribers with different addresses.

  • SubscriptionType (string) -- [REQUIRED] The subscription type of the subscriber. It can be SMS or EMAIL.

  • Address (string) -- [REQUIRED] A generic String.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of CreateSubscriber

DeleteNotification (updated) Link ¶
Changes (request)
{'Notification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Delete a notification and related subscribers

See also: AWS API Documentation

Request Syntax

client.delete_notification(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    }
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type Notification

dict

param Notification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of DeleteNotification

DeleteSubscriber (updated) Link ¶
Changes (request)
{'Notification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Delete a Subscriber for a notification

See also: AWS API Documentation

Request Syntax

client.delete_subscriber(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    },
    Subscriber={
        'SubscriptionType': 'SNS'|'EMAIL',
        'Address': 'string'
    }
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type Notification

dict

param Notification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

type Subscriber

dict

param Subscriber

[REQUIRED] Subscriber model. Each notification may contain multiple subscribers with different addresses.

  • SubscriptionType (string) -- [REQUIRED] The subscription type of the subscriber. It can be SMS or EMAIL.

  • Address (string) -- [REQUIRED] A generic String.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of DeleteSubscriber

DescribeNotificationsForBudget (updated) Link ¶
Changes (response)
{'Notifications': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Get notifications of a budget

See also: AWS API Documentation

Request Syntax

client.describe_notifications_for_budget(
    AccountId='string',
    BudgetName='string',
    MaxResults=123,
    NextToken='string'
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type MaxResults

integer

param MaxResults

An integer to represent how many entries a paginated response contains. Maximum is set to 100.

type NextToken

string

param NextToken

A generic String.

rtype

dict

returns

Response Syntax

{
    'Notifications': [
        {
            'NotificationType': 'ACTUAL'|'FORECASTED',
            'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
            'Threshold': 123.0,
            'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- Response of GetNotificationsForBudget

    • Notifications (list) -- A list of notifications.

      • (dict) -- Notification model. Each budget may contain multiple notifications with different settings.

        • NotificationType (string) -- The type of a notification. It should be ACTUAL or FORECASTED.

        • ComparisonOperator (string) -- The comparison operator of a notification. Currently we support less than, equal to and greater than.

        • Threshold (float) -- The threshold of a notification. It should be a number between 0 and 1,000,000,000.

        • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

    • NextToken (string) -- A generic String.

DescribeSubscribersForNotification (updated) Link ¶
Changes (request)
{'Notification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Get subscribers of a notification

See also: AWS API Documentation

Request Syntax

client.describe_subscribers_for_notification(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    },
    MaxResults=123,
    NextToken='string'
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type Notification

dict

param Notification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

type MaxResults

integer

param MaxResults

An integer to represent how many entries a paginated response contains. Maximum is set to 100.

type NextToken

string

param NextToken

A generic String.

rtype

dict

returns

Response Syntax

{
    'Subscribers': [
        {
            'SubscriptionType': 'SNS'|'EMAIL',
            'Address': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- Response of DescribeSubscribersForNotification

    • Subscribers (list) -- A list of subscribers.

      • (dict) -- Subscriber model. Each notification may contain multiple subscribers with different addresses.

        • SubscriptionType (string) -- The subscription type of the subscriber. It can be SMS or EMAIL.

        • Address (string) -- A generic String.

    • NextToken (string) -- A generic String.

UpdateNotification (updated) Link ¶
Changes (request)
{'NewNotification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'},
 'OldNotification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Update the information about a notification already created

See also: AWS API Documentation

Request Syntax

client.update_notification(
    AccountId='string',
    BudgetName='string',
    OldNotification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    },
    NewNotification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    }
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type OldNotification

dict

param OldNotification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

type NewNotification

dict

param NewNotification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of UpdateNotification

UpdateSubscriber (updated) Link ¶
Changes (request)
{'Notification': {'ThresholdType': 'PERCENTAGE | ABSOLUTE_VALUE'}}

Update a subscriber

See also: AWS API Documentation

Request Syntax

client.update_subscriber(
    AccountId='string',
    BudgetName='string',
    Notification={
        'NotificationType': 'ACTUAL'|'FORECASTED',
        'ComparisonOperator': 'GREATER_THAN'|'LESS_THAN'|'EQUAL_TO',
        'Threshold': 123.0,
        'ThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
    },
    OldSubscriber={
        'SubscriptionType': 'SNS'|'EMAIL',
        'Address': 'string'
    },
    NewSubscriber={
        'SubscriptionType': 'SNS'|'EMAIL',
        'Address': 'string'
    }
)
type AccountId

string

param AccountId

[REQUIRED] Account Id of the customer. It should be a 12 digit number.

type BudgetName

string

param BudgetName

[REQUIRED] A string represents the budget name. No ":" and "" character is allowed.

type Notification

dict

param Notification

[REQUIRED] Notification model. Each budget may contain multiple notifications with different settings.

  • NotificationType (string) -- [REQUIRED] The type of a notification. It should be ACTUAL or FORECASTED.

  • ComparisonOperator (string) -- [REQUIRED] The comparison operator of a notification. Currently we support less than, equal to and greater than.

  • Threshold (float) -- [REQUIRED] The threshold of a notification. It should be a number between 0 and 1,000,000,000.

  • ThresholdType (string) -- The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.

type OldSubscriber

dict

param OldSubscriber

[REQUIRED] Subscriber model. Each notification may contain multiple subscribers with different addresses.

  • SubscriptionType (string) -- [REQUIRED] The subscription type of the subscriber. It can be SMS or EMAIL.

  • Address (string) -- [REQUIRED] A generic String.

type NewSubscriber

dict

param NewSubscriber

[REQUIRED] Subscriber model. Each notification may contain multiple subscribers with different addresses.

  • SubscriptionType (string) -- [REQUIRED] The subscription type of the subscriber. It can be SMS or EMAIL.

  • Address (string) -- [REQUIRED] A generic String.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) -- Response of UpdateSubscriber