You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::Budgets::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



152
153
154
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 152

def initialize(*args)
  super
end

Instance Method Details

#create_budget(params = {}) ⇒ Struct

Create a new budget

Examples:

Request syntax with placeholder values


resp = client.create_budget({
  account_id: "AccountId", # required
  budget: { # required
    budget_name: "BudgetName", # required
    budget_limit: { # required
      amount: "NumericValue", # required
      unit: "UnitValue", # required
    },
    cost_filters: {
      "GenericString" => ["GenericString"],
    },
    cost_types: { # required
      include_tax: false, # required
      include_subscription: false, # required
      use_blended: false, # required
    },
    time_unit: "DAILY", # required, accepts DAILY, MONTHLY, QUARTERLY, ANNUALLY
    time_period: { # required
      start: Time.now, # required
      end: Time.now, # required
    },
    calculated_spend: {
      actual_spend: { # required
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
      forecasted_spend: {
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
    },
    budget_type: "USAGE", # required, accepts USAGE, COST, RI_UTILIZATION
  },
  notifications_with_subscribers: [
    {
      notification: { # required
        notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
        comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
        threshold: 1.0, # required
        threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
      },
      subscribers: [ # required
        {
          subscription_type: "SNS", # required, accepts SNS, EMAIL
          address: "GenericString", # required
        },
      ],
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget (required, Types::Budget)

    AWS Budget model

  • :notifications_with_subscribers (Array<Types::NotificationWithSubscribers>)

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

Returns:

  • (Struct)

    Returns an empty response.



226
227
228
229
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 226

def create_budget(params = {}, options = {})
  req = build_request(:create_budget, params)
  req.send_request(options)
end

#create_notification(params = {}) ⇒ Struct

Create a new Notification with subscribers for a budget

Examples:

Request syntax with placeholder values


resp = client.create_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  subscribers: [ # required
    {
      subscription_type: "SNS", # required, accepts SNS, EMAIL
      address: "GenericString", # required
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :notification (required, Types::Notification)

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

  • :subscribers (required, Array<Types::Subscriber>)

    A list of subscribers.

Returns:

  • (Struct)

    Returns an empty response.



270
271
272
273
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 270

def create_notification(params = {}, options = {})
  req = build_request(:create_notification, params)
  req.send_request(options)
end

#create_subscriber(params = {}) ⇒ Struct

Create a new Subscriber for a notification

Examples:

Request syntax with placeholder values


resp = client.create_subscriber({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "GenericString", # required
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :notification (required, Types::Notification)

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

  • :subscriber (required, Types::Subscriber)

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

Returns:

  • (Struct)

    Returns an empty response.



313
314
315
316
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 313

def create_subscriber(params = {}, options = {})
  req = build_request(:create_subscriber, params)
  req.send_request(options)
end

#delete_budget(params = {}) ⇒ Struct

Delete a budget and related notifications

Examples:

Request syntax with placeholder values


resp = client.delete_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

Returns:

  • (Struct)

    Returns an empty response.



338
339
340
341
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 338

def delete_budget(params = {}, options = {})
  req = build_request(:delete_budget, params)
  req.send_request(options)
end

#delete_notification(params = {}) ⇒ Struct

Delete a notification and related subscribers

Examples:

Request syntax with placeholder values


resp = client.delete_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :notification (required, Types::Notification)

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

Returns:

  • (Struct)

    Returns an empty response.



373
374
375
376
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 373

def delete_notification(params = {}, options = {})
  req = build_request(:delete_notification, params)
  req.send_request(options)
end

#delete_subscriber(params = {}) ⇒ Struct

Delete a Subscriber for a notification

Examples:

Request syntax with placeholder values


resp = client.delete_subscriber({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "GenericString", # required
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :notification (required, Types::Notification)

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

  • :subscriber (required, Types::Subscriber)

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

Returns:

  • (Struct)

    Returns an empty response.



416
417
418
419
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 416

def delete_subscriber(params = {}, options = {})
  req = build_request(:delete_subscriber, params)
  req.send_request(options)
end

#describe_budget(params = {}) ⇒ Types::DescribeBudgetResponse

Get a single budget

Examples:

Request syntax with placeholder values


resp = client.describe_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
})

Response structure


resp.budget.budget_name #=> String
resp.budget.budget_limit.amount #=> String
resp.budget.budget_limit.unit #=> String
resp.budget.cost_filters #=> Hash
resp.budget.cost_filters["GenericString"] #=> Array
resp.budget.cost_filters["GenericString"][0] #=> String
resp.budget.cost_types.include_tax #=> Boolean
resp.budget.cost_types.include_subscription #=> Boolean
resp.budget.cost_types.use_blended #=> Boolean
resp.budget.time_unit #=> String, one of "DAILY", "MONTHLY", "QUARTERLY", "ANNUALLY"
resp.budget.time_period.start #=> Time
resp.budget.time_period.end #=> Time
resp.budget.calculated_spend.actual_spend.amount #=> String
resp.budget.calculated_spend.actual_spend.unit #=> String
resp.budget.calculated_spend.forecasted_spend.amount #=> String
resp.budget.calculated_spend.forecasted_spend.unit #=> String
resp.budget.budget_type #=> String, one of "USAGE", "COST", "RI_UTILIZATION"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

Returns:



463
464
465
466
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 463

def describe_budget(params = {}, options = {})
  req = build_request(:describe_budget, params)
  req.send_request(options)
end

#describe_budgets(params = {}) ⇒ Types::DescribeBudgetsResponse

Get all budgets for an account

Examples:

Request syntax with placeholder values


resp = client.describe_budgets({
  account_id: "AccountId", # required
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.budgets #=> Array
resp.budgets[0].budget_name #=> String
resp.budgets[0].budget_limit.amount #=> String
resp.budgets[0].budget_limit.unit #=> String
resp.budgets[0].cost_filters #=> Hash
resp.budgets[0].cost_filters["GenericString"] #=> Array
resp.budgets[0].cost_filters["GenericString"][0] #=> String
resp.budgets[0].cost_types.include_tax #=> Boolean
resp.budgets[0].cost_types.include_subscription #=> Boolean
resp.budgets[0].cost_types.use_blended #=> Boolean
resp.budgets[0].time_unit #=> String, one of "DAILY", "MONTHLY", "QUARTERLY", "ANNUALLY"
resp.budgets[0].time_period.start #=> Time
resp.budgets[0].time_period.end #=> Time
resp.budgets[0].calculated_spend.actual_spend.amount #=> String
resp.budgets[0].calculated_spend.actual_spend.unit #=> String
resp.budgets[0].calculated_spend.forecasted_spend.amount #=> String
resp.budgets[0].calculated_spend.forecasted_spend.unit #=> String
resp.budgets[0].budget_type #=> String, one of "USAGE", "COST", "RI_UTILIZATION"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :max_results (Integer)

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

  • :next_token (String)

    A generic String.

Returns:



517
518
519
520
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 517

def describe_budgets(params = {}, options = {})
  req = build_request(:describe_budgets, params)
  req.send_request(options)
end

#describe_notifications_for_budget(params = {}) ⇒ Types::DescribeNotificationsForBudgetResponse

Get notifications of a budget

Examples:

Request syntax with placeholder values


resp = client.describe_notifications_for_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.notifications #=> Array
resp.notifications[0].notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.notifications[0].comparison_operator #=> String, one of "GREATER_THAN", "LESS_THAN", "EQUAL_TO"
resp.notifications[0].threshold #=> Float
resp.notifications[0].threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :max_results (Integer)

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

  • :next_token (String)

    A generic String.

Returns:



563
564
565
566
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 563

def describe_notifications_for_budget(params = {}, options = {})
  req = build_request(:describe_notifications_for_budget, params)
  req.send_request(options)
end

#describe_subscribers_for_notification(params = {}) ⇒ Types::DescribeSubscribersForNotificationResponse

Get subscribers of a notification

Examples:

Request syntax with placeholder values


resp = client.describe_subscribers_for_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.subscribers #=> Array
resp.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.subscribers[0].address #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :notification (required, Types::Notification)

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

  • :max_results (Integer)

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

  • :next_token (String)

    A generic String.

Returns:



617
618
619
620
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 617

def describe_subscribers_for_notification(params = {}, options = {})
  req = build_request(:describe_subscribers_for_notification, params)
  req.send_request(options)
end

#update_budget(params = {}) ⇒ Struct

Update the information of a budget already created

Examples:

Request syntax with placeholder values


resp = client.update_budget({
  account_id: "AccountId", # required
  new_budget: { # required
    budget_name: "BudgetName", # required
    budget_limit: { # required
      amount: "NumericValue", # required
      unit: "UnitValue", # required
    },
    cost_filters: {
      "GenericString" => ["GenericString"],
    },
    cost_types: { # required
      include_tax: false, # required
      include_subscription: false, # required
      use_blended: false, # required
    },
    time_unit: "DAILY", # required, accepts DAILY, MONTHLY, QUARTERLY, ANNUALLY
    time_period: { # required
      start: Time.now, # required
      end: Time.now, # required
    },
    calculated_spend: {
      actual_spend: { # required
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
      forecasted_spend: {
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
    },
    budget_type: "USAGE", # required, accepts USAGE, COST, RI_UTILIZATION
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :new_budget (required, Types::Budget)

    AWS Budget model

Returns:

  • (Struct)

    Returns an empty response.



671
672
673
674
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 671

def update_budget(params = {}, options = {})
  req = build_request(:update_budget, params)
  req.send_request(options)
end

#update_notification(params = {}) ⇒ Struct

Update the information about a notification already created

Examples:

Request syntax with placeholder values


resp = client.update_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  old_notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  new_notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :old_notification (required, Types::Notification)

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

  • :new_notification (required, Types::Notification)

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

Returns:

  • (Struct)

    Returns an empty response.



716
717
718
719
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 716

def update_notification(params = {}, options = {})
  req = build_request(:update_notification, params)
  req.send_request(options)
end

#update_subscriber(params = {}) ⇒ Struct

Update a subscriber

Examples:

Request syntax with placeholder values


resp = client.update_subscriber({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  old_subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "GenericString", # required
  },
  new_subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "GenericString", # required
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :account_id (required, String)

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

  • :budget_name (required, String)

    A string represents the budget name. No ":" and "\" character is allowed.

  • :notification (required, Types::Notification)

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

  • :old_subscriber (required, Types::Subscriber)

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

  • :new_subscriber (required, Types::Subscriber)

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

Returns:

  • (Struct)

    Returns an empty response.



767
768
769
770
# File 'gems/aws-sdk-budgets/lib/aws-sdk-budgets/client.rb', line 767

def update_subscriber(params = {}, options = {})
  req = build_request(:update_subscriber, params)
  req.send_request(options)
end