SavingsPlans ************ Client ====== class SavingsPlans.Client A low-level client representing AWS Savings Plans (avingsPlans) Savings Plans are a pricing model that offer significant savings on Amazon Web Services usage (for example, on Amazon EC2 instances). You commit to a consistent amount of usage per hour, in the specified currency, for a term of one or three years, and receive a lower price for that usage. For more information, see the Amazon Web Services Savings Plans User Guide. import boto3 client = boto3.client('savingsplans') These are the available methods: * can_paginate * close * create_savings_plan * delete_queued_savings_plan * describe_savings_plan_rates * describe_savings_plans * describe_savings_plans_offering_rates * describe_savings_plans_offerings * get_paginator * get_waiter * list_tags_for_resource * return_savings_plan * tag_resource * untag_resource SavingsPlans / Client / get_paginator get_paginator ************* SavingsPlans.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. SavingsPlans / Client / can_paginate can_paginate ************ SavingsPlans.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. SavingsPlans / Client / create_savings_plan create_savings_plan ******************* SavingsPlans.Client.create_savings_plan(**kwargs) Creates a Savings Plan. See also: AWS API Documentation **Request Syntax** response = client.create_savings_plan( savingsPlanOfferingId='string', commitment='string', upfrontPaymentAmount='string', purchaseTime=datetime(2015, 1, 1), clientToken='string', tags={ 'string': 'string' } ) Parameters: * **savingsPlanOfferingId** (*string*) -- **[REQUIRED]** The ID of the offering. * **commitment** (*string*) -- **[REQUIRED]** The hourly commitment, in the same currency of the "savingsPlanOfferingId". This is a value between 0.001 and 1 million. You cannot specify more than five digits after the decimal point. * **upfrontPaymentAmount** (*string*) -- The up-front payment amount. This is a whole number between 50 and 99 percent of the total value of the Savings Plan. This parameter is only supported if the payment option is "Partial Upfront". * **purchaseTime** (*datetime*) -- The purchase time of the Savings Plan in UTC format (YYYY-MM-DDTHH:MM:SSZ). * **clientToken** (*string*) -- A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This field is autopopulated if not provided. * **tags** (*dict*) -- One or more tags. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'savingsPlanId': 'string' } **Response Structure** * *(dict) --* * **savingsPlanId** *(string) --* The ID of the Savings Plan. **Exceptions** * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.InternalServerException" * "SavingsPlans.Client.exceptions.ServiceQuotaExceededException" SavingsPlans / Client / list_tags_for_resource list_tags_for_resource ********************** SavingsPlans.Client.list_tags_for_resource(**kwargs) Lists the tags for the specified resource. See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( resourceArn='string' ) Parameters: **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. Return type: dict Returns: **Response Syntax** { 'tags': { 'string': 'string' } } **Response Structure** * *(dict) --* * **tags** *(dict) --* Information about the tags. * *(string) --* * *(string) --* **Exceptions** * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.InternalServerException" SavingsPlans / Client / describe_savings_plans_offerings describe_savings_plans_offerings ******************************** SavingsPlans.Client.describe_savings_plans_offerings(**kwargs) Describes the offerings for the specified Savings Plans. See also: AWS API Documentation **Request Syntax** response = client.describe_savings_plans_offerings( offeringIds=[ 'string', ], paymentOptions=[ 'All Upfront'|'Partial Upfront'|'No Upfront', ], productType='EC2'|'Fargate'|'Lambda'|'SageMaker', planTypes=[ 'Compute'|'EC2Instance'|'SageMaker', ], durations=[ 123, ], currencies=[ 'CNY'|'USD', ], descriptions=[ 'string', ], serviceCodes=[ 'string', ], usageTypes=[ 'string', ], operations=[ 'string', ], filters=[ { 'name': 'region'|'instanceFamily', 'values': [ 'string', ] }, ], nextToken='string', maxResults=123 ) Parameters: * **offeringIds** (*list*) -- The IDs of the offerings. * *(string) --* * **paymentOptions** (*list*) -- The payment options. * *(string) --* * **productType** (*string*) -- The product type. * **planTypes** (*list*) -- The plan types. * *(string) --* * **durations** (*list*) -- The duration, in seconds. * *(integer) --* * **currencies** (*list*) -- The currencies. * *(string) --* * **descriptions** (*list*) -- The descriptions. * *(string) --* * **serviceCodes** (*list*) -- The services. * *(string) --* * **usageTypes** (*list*) -- The usage details of the line item in the billing report. * *(string) --* * **operations** (*list*) -- The specific Amazon Web Services operation for the line item in the billing report. * *(string) --* * **filters** (*list*) -- The filters. * *(dict) --* Information about a Savings Plan offering filter. * **name** *(string) --* The filter name. * **values** *(list) --* The filter values. * *(string) --* * **nextToken** (*string*) -- The token for the next page of results. * **maxResults** (*integer*) -- The maximum number of results to return with a single call. To retrieve additional results, make another call with the returned token value. Return type: dict Returns: **Response Syntax** { 'searchResults': [ { 'offeringId': 'string', 'productTypes': [ 'EC2'|'Fargate'|'Lambda'|'SageMaker', ], 'planType': 'Compute'|'EC2Instance'|'SageMaker', 'description': 'string', 'paymentOption': 'All Upfront'|'Partial Upfront'|'No Upfront', 'durationSeconds': 123, 'currency': 'CNY'|'USD', 'serviceCode': 'string', 'usageType': 'string', 'operation': 'string', 'properties': [ { 'name': 'region'|'instanceFamily', 'value': 'string' }, ] }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **searchResults** *(list) --* Information about the Savings Plans offerings. * *(dict) --* Information about a Savings Plan offering. * **offeringId** *(string) --* The ID of the offering. * **productTypes** *(list) --* The product type. * *(string) --* * **planType** *(string) --* The plan type. * **description** *(string) --* The description. * **paymentOption** *(string) --* The payment option. * **durationSeconds** *(integer) --* The duration, in seconds. * **currency** *(string) --* The currency. * **serviceCode** *(string) --* The service. * **usageType** *(string) --* The usage details of the line item in the billing report. * **operation** *(string) --* The specific Amazon Web Services operation for the line item in the billing report. * **properties** *(list) --* The properties. * *(dict) --* Information about a Savings Plan offering property. * **name** *(string) --* The property name. * **value** *(string) --* The property value. * **nextToken** *(string) --* The token to use to retrieve the next page of results. This value is null when there are no more results to return. **Exceptions** * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.InternalServerException" SavingsPlans / Client / untag_resource untag_resource ************** SavingsPlans.Client.untag_resource(**kwargs) Removes the specified tags from the specified resource. See also: AWS API Documentation **Request Syntax** response = client.untag_resource( resourceArn='string', tagKeys=[ 'string', ] ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. * **tagKeys** (*list*) -- **[REQUIRED]** The tag keys. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.InternalServerException" SavingsPlans / Client / get_waiter get_waiter ********** SavingsPlans.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" SavingsPlans / Client / describe_savings_plan_rates describe_savings_plan_rates *************************** SavingsPlans.Client.describe_savings_plan_rates(**kwargs) Describes the rates for the specified Savings Plan. See also: AWS API Documentation **Request Syntax** response = client.describe_savings_plan_rates( savingsPlanId='string', filters=[ { 'name': 'region'|'instanceType'|'productDescription'|'tenancy'|'productType'|'serviceCode'|'usageType'|'operation', 'values': [ 'string', ] }, ], nextToken='string', maxResults=123 ) Parameters: * **savingsPlanId** (*string*) -- **[REQUIRED]** The ID of the Savings Plan. * **filters** (*list*) -- The filters. * *(dict) --* Information about a Savings Plan rate filter. * **name** *(string) --* The filter name. * **values** *(list) --* The filter values. * *(string) --* * **nextToken** (*string*) -- The token for the next page of results. * **maxResults** (*integer*) -- The maximum number of results to return with a single call. To retrieve additional results, make another call with the returned token value. Return type: dict Returns: **Response Syntax** { 'savingsPlanId': 'string', 'searchResults': [ { 'rate': 'string', 'currency': 'CNY'|'USD', 'unit': 'Hrs'|'Lambda-GB-Second'|'Request', 'productType': 'EC2'|'Fargate'|'Lambda'|'SageMaker', 'serviceCode': 'AmazonEC2'|'AmazonECS'|'AmazonEKS'|'AWSLambda'|'AmazonSageMaker', 'usageType': 'string', 'operation': 'string', 'properties': [ { 'name': 'region'|'instanceType'|'instanceFamily'|'productDescription'|'tenancy', 'value': 'string' }, ] }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **savingsPlanId** *(string) --* The ID of the Savings Plan. * **searchResults** *(list) --* Information about the Savings Plan rates. * *(dict) --* Information about a Savings Plan rate. * **rate** *(string) --* The rate. * **currency** *(string) --* The currency. * **unit** *(string) --* The unit. * **productType** *(string) --* The product type. * **serviceCode** *(string) --* The service. * **usageType** *(string) --* The usage details of the line item in the billing report. * **operation** *(string) --* The specific Amazon Web Services operation for the line item in the billing report. * **properties** *(list) --* The properties. * *(dict) --* Information about a Savings Plan rate property. * **name** *(string) --* The property name. * **value** *(string) --* The property value. * **nextToken** *(string) --* The token to use to retrieve the next page of results. This value is null when there are no more results to return. **Exceptions** * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.ValidationException" SavingsPlans / Client / describe_savings_plans_offering_rates describe_savings_plans_offering_rates ************************************* SavingsPlans.Client.describe_savings_plans_offering_rates(**kwargs) Describes the offering rates for the specified Savings Plans. See also: AWS API Documentation **Request Syntax** response = client.describe_savings_plans_offering_rates( savingsPlanOfferingIds=[ 'string', ], savingsPlanPaymentOptions=[ 'All Upfront'|'Partial Upfront'|'No Upfront', ], savingsPlanTypes=[ 'Compute'|'EC2Instance'|'SageMaker', ], products=[ 'EC2'|'Fargate'|'Lambda'|'SageMaker', ], serviceCodes=[ 'AmazonEC2'|'AmazonECS'|'AmazonEKS'|'AWSLambda'|'AmazonSageMaker', ], usageTypes=[ 'string', ], operations=[ 'string', ], filters=[ { 'name': 'region'|'instanceFamily'|'instanceType'|'productDescription'|'tenancy'|'productId', 'values': [ 'string', ] }, ], nextToken='string', maxResults=123 ) Parameters: * **savingsPlanOfferingIds** (*list*) -- The IDs of the offerings. * *(string) --* * **savingsPlanPaymentOptions** (*list*) -- The payment options. * *(string) --* * **savingsPlanTypes** (*list*) -- The plan types. * *(string) --* * **products** (*list*) -- The Amazon Web Services products. * *(string) --* * **serviceCodes** (*list*) -- The services. * *(string) --* * **usageTypes** (*list*) -- The usage details of the line item in the billing report. * *(string) --* * **operations** (*list*) -- The specific Amazon Web Services operation for the line item in the billing report. * *(string) --* * **filters** (*list*) -- The filters. * *(dict) --* Information about a Savings Plan offering rate filter. * **name** *(string) --* The filter name. * **values** *(list) --* The filter values. * *(string) --* * **nextToken** (*string*) -- The token for the next page of results. * **maxResults** (*integer*) -- The maximum number of results to return with a single call. To retrieve additional results, make another call with the returned token value. Return type: dict Returns: **Response Syntax** { 'searchResults': [ { 'savingsPlanOffering': { 'offeringId': 'string', 'paymentOption': 'All Upfront'|'Partial Upfront'|'No Upfront', 'planType': 'Compute'|'EC2Instance'|'SageMaker', 'durationSeconds': 123, 'currency': 'CNY'|'USD', 'planDescription': 'string' }, 'rate': 'string', 'unit': 'Hrs'|'Lambda-GB-Second'|'Request', 'productType': 'EC2'|'Fargate'|'Lambda'|'SageMaker', 'serviceCode': 'AmazonEC2'|'AmazonECS'|'AmazonEKS'|'AWSLambda'|'AmazonSageMaker', 'usageType': 'string', 'operation': 'string', 'properties': [ { 'name': 'string', 'value': 'string' }, ] }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **searchResults** *(list) --* Information about the Savings Plans offering rates. * *(dict) --* Information about a Savings Plan offering rate. * **savingsPlanOffering** *(dict) --* The Savings Plan offering. * **offeringId** *(string) --* The ID of the offering. * **paymentOption** *(string) --* The payment option. * **planType** *(string) --* The plan type. * **durationSeconds** *(integer) --* The duration, in seconds. * **currency** *(string) --* The currency. * **planDescription** *(string) --* The description. * **rate** *(string) --* The Savings Plan rate. * **unit** *(string) --* The unit. * **productType** *(string) --* The product type. * **serviceCode** *(string) --* The service. * **usageType** *(string) --* The usage details of the line item in the billing report. * **operation** *(string) --* The specific Amazon Web Services operation for the line item in the billing report. * **properties** *(list) --* The properties. * *(dict) --* Information about a Savings Plan offering rate property. * **name** *(string) --* The property name. * **value** *(string) --* The property value. * **nextToken** *(string) --* The token to use to retrieve the next page of results. This value is null when there are no more results to return. **Exceptions** * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.InternalServerException" SavingsPlans / Client / close close ***** SavingsPlans.Client.close() Closes underlying endpoint connections. SavingsPlans / Client / return_savings_plan return_savings_plan ******************* SavingsPlans.Client.return_savings_plan(**kwargs) Returns the specified Savings Plan. See also: AWS API Documentation **Request Syntax** response = client.return_savings_plan( savingsPlanId='string', clientToken='string' ) Parameters: * **savingsPlanId** (*string*) -- **[REQUIRED]** The ID of the Savings Plan. * **clientToken** (*string*) -- A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This field is autopopulated if not provided. Return type: dict Returns: **Response Syntax** { 'savingsPlanId': 'string' } **Response Structure** * *(dict) --* * **savingsPlanId** *(string) --* The ID of the Savings Plan. **Exceptions** * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.InternalServerException" * "SavingsPlans.Client.exceptions.ServiceQuotaExceededException" SavingsPlans / Client / delete_queued_savings_plan delete_queued_savings_plan ************************** SavingsPlans.Client.delete_queued_savings_plan(**kwargs) Deletes the queued purchase for the specified Savings Plan. See also: AWS API Documentation **Request Syntax** response = client.delete_queued_savings_plan( savingsPlanId='string' ) Parameters: **savingsPlanId** (*string*) -- **[REQUIRED]** The ID of the Savings Plan. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.InternalServerException" * "SavingsPlans.Client.exceptions.ServiceQuotaExceededException" SavingsPlans / Client / describe_savings_plans describe_savings_plans ********************** SavingsPlans.Client.describe_savings_plans(**kwargs) Describes the specified Savings Plans. See also: AWS API Documentation **Request Syntax** response = client.describe_savings_plans( savingsPlanArns=[ 'string', ], savingsPlanIds=[ 'string', ], nextToken='string', maxResults=123, states=[ 'payment-pending'|'payment-failed'|'active'|'retired'|'queued'|'queued-deleted'|'pending-return'|'returned', ], filters=[ { 'name': 'region'|'ec2-instance-family'|'commitment'|'upfront'|'term'|'savings-plan-type'|'payment-option'|'start'|'end', 'values': [ 'string', ] }, ] ) Parameters: * **savingsPlanArns** (*list*) -- The Amazon Resource Names (ARN) of the Savings Plans. * *(string) --* * **savingsPlanIds** (*list*) -- The IDs of the Savings Plans. * *(string) --* * **nextToken** (*string*) -- The token for the next page of results. * **maxResults** (*integer*) -- The maximum number of results to return with a single call. To retrieve additional results, make another call with the returned token value. * **states** (*list*) -- The current states of the Savings Plans. * *(string) --* * **filters** (*list*) -- The filters. * *(dict) --* Information about a Savings Plan filter. * **name** *(string) --* The filter name. * **values** *(list) --* The filter value. * *(string) --* Return type: dict Returns: **Response Syntax** { 'savingsPlans': [ { 'offeringId': 'string', 'savingsPlanId': 'string', 'savingsPlanArn': 'string', 'description': 'string', 'start': 'string', 'end': 'string', 'state': 'payment-pending'|'payment-failed'|'active'|'retired'|'queued'|'queued-deleted'|'pending-return'|'returned', 'region': 'string', 'ec2InstanceFamily': 'string', 'savingsPlanType': 'Compute'|'EC2Instance'|'SageMaker', 'paymentOption': 'All Upfront'|'Partial Upfront'|'No Upfront', 'productTypes': [ 'EC2'|'Fargate'|'Lambda'|'SageMaker', ], 'currency': 'CNY'|'USD', 'commitment': 'string', 'upfrontPaymentAmount': 'string', 'recurringPaymentAmount': 'string', 'termDurationInSeconds': 123, 'tags': { 'string': 'string' }, 'returnableUntil': 'string' }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **savingsPlans** *(list) --* Information about the Savings Plans. * *(dict) --* Information about a Savings Plan. * **offeringId** *(string) --* The ID of the offering. * **savingsPlanId** *(string) --* The ID of the Savings Plan. * **savingsPlanArn** *(string) --* The Amazon Resource Name (ARN) of the Savings Plan. * **description** *(string) --* The description. * **start** *(string) --* The start time. * **end** *(string) --* The end time. * **state** *(string) --* The current state. * **region** *(string) --* The Amazon Web Services Region. * **ec2InstanceFamily** *(string) --* The EC2 instance family. * **savingsPlanType** *(string) --* The plan type. * **paymentOption** *(string) --* The payment option. * **productTypes** *(list) --* The product types. * *(string) --* * **currency** *(string) --* The currency. * **commitment** *(string) --* The hourly commitment amount in the specified currency. * **upfrontPaymentAmount** *(string) --* The up-front payment amount. * **recurringPaymentAmount** *(string) --* The recurring payment amount. * **termDurationInSeconds** *(integer) --* The duration of the term, in seconds. * **tags** *(dict) --* One or more tags. * *(string) --* * *(string) --* * **returnableUntil** *(string) --* The time until when a return for the Savings Plan can be requested. If the Savings Plan is not returnable, the field reflects the Savings Plan start time. * **nextToken** *(string) --* The token to use to retrieve the next page of results. This value is null when there are no more results to return. **Exceptions** * "SavingsPlans.Client.exceptions.InternalServerException" * "SavingsPlans.Client.exceptions.ValidationException" SavingsPlans / Client / tag_resource tag_resource ************ SavingsPlans.Client.tag_resource(**kwargs) Adds the specified tags to the specified resource. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( resourceArn='string', tags={ 'string': 'string' } ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. * **tags** (*dict*) -- **[REQUIRED]** One or more tags. For example, { "tags": {"key1":"value1", "key2":"value2"} }. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SavingsPlans.Client.exceptions.ResourceNotFoundException" * "SavingsPlans.Client.exceptions.ServiceQuotaExceededException" * "SavingsPlans.Client.exceptions.ValidationException" * "SavingsPlans.Client.exceptions.InternalServerException"