Documentation

Overview

    Package pricing provides the API client, operations, and parameter types for AWS Price List Service.

    AWS Price List Service API (AWS Price List Service) is a centralized and convenient way to programmatically query Amazon Web Services for services, products, and pricing information. The AWS Price List Service uses standardized product attributes such as Location, Storage Class, and Operating System, and provides prices at the SKU level. You can use the AWS Price List Service to build cost control and scenario planning tools, reconcile billing data, forecast future spend for budgeting purposes, and provide cost benefit analysis that compare your internal workloads with AWS. Use GetServices without a service code to retrieve the service codes for all AWS services, then GetServices with a service code to retreive the attribute names for that service. After you have the service code and attribute names, you can use GetAttributeValues to see what values are available for an attribute. With the service code and an attribute name and value, you can use GetProducts to find specific products that you're interested in, such as an AmazonEC2 instance, with a Provisioned IOPSvolumeType. Service Endpoint AWS Price List Service API provides the following two endpoints:

    * https://api.pricing.us-east-1.amazonaws.com

    * https://api.pricing.ap-south-1.amazonaws.com

    Index

    Constants

    View Source
    const ServiceAPIVersion = "2017-10-15"
    View Source
    const ServiceID = "Pricing"

    Variables

    This section is empty.

    Functions

    func NewDefaultEndpointResolver

    func NewDefaultEndpointResolver() *internalendpoints.Resolver

      NewDefaultEndpointResolver constructs a new service endpoint resolver

      func WithAPIOptions

      func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options)

        WithAPIOptions returns a functional option for setting the Client's APIOptions option.

        func WithEndpointResolver

        func WithEndpointResolver(v EndpointResolver) func(*Options)

          WithEndpointResolver returns a functional option for setting the Client's EndpointResolver option.

          Types

          type Client

          type Client struct {
          	// contains filtered or unexported fields
          }

            Client provides the API client to make operations call for AWS Price List Service.

            func New

            func New(options Options, optFns ...func(*Options)) *Client

              New returns an initialized Client based on the functional options. Provide additional functional options to further configure the behavior of the client, such as changing the client's endpoint or adding custom middleware behavior.

              func NewFromConfig

              func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client

                NewFromConfig returns a new client from the provided config.

                func (*Client) DescribeServices

                func (c *Client) DescribeServices(ctx context.Context, params *DescribeServicesInput, optFns ...func(*Options)) (*DescribeServicesOutput, error)

                  Returns the metadata for one service or a list of the metadata for all services. Use this without a service code to get the service codes for all services. Use it with a service code, such as AmazonEC2, to get information specific to that service, such as the attribute names available for that service. For example, some of the attribute names available for EC2 are volumeType, maxIopsVolume, operation, locationType, and instanceCapacity10xlarge.

                  func (*Client) GetAttributeValues

                  func (c *Client) GetAttributeValues(ctx context.Context, params *GetAttributeValuesInput, optFns ...func(*Options)) (*GetAttributeValuesOutput, error)

                    Returns a list of attribute values. Attibutes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs) in the AWS Billing and Cost Management User Guide (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html).

                    func (*Client) GetProducts

                    func (c *Client) GetProducts(ctx context.Context, params *GetProductsInput, optFns ...func(*Options)) (*GetProductsOutput, error)

                      Returns a list of all products that match the filter criteria.

                      type DescribeServicesAPIClient

                      type DescribeServicesAPIClient interface {
                      	DescribeServices(context.Context, *DescribeServicesInput, ...func(*Options)) (*DescribeServicesOutput, error)
                      }

                        DescribeServicesAPIClient is a client that implements the DescribeServices operation.

                        type DescribeServicesInput

                        type DescribeServicesInput struct {
                        
                        	// The format version that you want the response to be in. Valid values are: aws_v1
                        	FormatVersion *string
                        
                        	// The maximum number of results that you want returned in the response.
                        	MaxResults int32
                        
                        	// The pagination token that indicates the next set of results that you want to
                        	// retrieve.
                        	NextToken *string
                        
                        	// The code for the service whose information you want to retrieve, such as
                        	// AmazonEC2. You can use the ServiceCode to filter the results in a GetProducts
                        	// call. To retrieve a list of all services, leave this blank.
                        	ServiceCode *string
                        }

                        type DescribeServicesOutput

                        type DescribeServicesOutput struct {
                        
                        	// The format version of the response. For example, aws_v1.
                        	FormatVersion *string
                        
                        	// The pagination token for the next set of retreivable results.
                        	NextToken *string
                        
                        	// The service metadata for the service or services in the response.
                        	Services []types.Service
                        
                        	// Metadata pertaining to the operation's result.
                        	ResultMetadata middleware.Metadata
                        }

                        type DescribeServicesPaginator

                        type DescribeServicesPaginator struct {
                        	// contains filtered or unexported fields
                        }

                          DescribeServicesPaginator is a paginator for DescribeServices

                          func NewDescribeServicesPaginator

                          func NewDescribeServicesPaginator(client DescribeServicesAPIClient, params *DescribeServicesInput, optFns ...func(*DescribeServicesPaginatorOptions)) *DescribeServicesPaginator

                            NewDescribeServicesPaginator returns a new DescribeServicesPaginator

                            func (*DescribeServicesPaginator) HasMorePages

                            func (p *DescribeServicesPaginator) HasMorePages() bool

                              HasMorePages returns a boolean indicating whether more pages are available

                              func (*DescribeServicesPaginator) NextPage

                              func (p *DescribeServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServicesOutput, error)

                                NextPage retrieves the next DescribeServices page.

                                type DescribeServicesPaginatorOptions

                                type DescribeServicesPaginatorOptions struct {
                                	// The maximum number of results that you want returned in the response.
                                	Limit int32
                                
                                	// Set to true if pagination should stop if the service returns a pagination token
                                	// that matches the most recent token provided to the service.
                                	StopOnDuplicateToken bool
                                }

                                  DescribeServicesPaginatorOptions is the paginator options for DescribeServices

                                  type EndpointResolver

                                  type EndpointResolver interface {
                                  	ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
                                  }

                                    EndpointResolver interface for resolving service endpoints.

                                    func EndpointResolverFromURL

                                    func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver

                                      EndpointResolverFromURL returns an EndpointResolver configured using the provided endpoint url. By default, the resolved endpoint resolver uses the client region as signing region, and the endpoint source is set to EndpointSourceCustom.You can provide functional options to configure endpoint values for the resolved endpoint.

                                      type EndpointResolverFunc

                                      type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)

                                        EndpointResolverFunc is a helper utility that wraps a function so it satisfies the EndpointResolver interface. This is useful when you want to add additional endpoint resolving logic, or stub out specific endpoints with custom values.

                                        func (EndpointResolverFunc) ResolveEndpoint

                                        func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error)

                                        type EndpointResolverOptions

                                        type EndpointResolverOptions = internalendpoints.Options

                                          EndpointResolverOptions is the service endpoint resolver options

                                          type GetAttributeValuesAPIClient

                                          type GetAttributeValuesAPIClient interface {
                                          	GetAttributeValues(context.Context, *GetAttributeValuesInput, ...func(*Options)) (*GetAttributeValuesOutput, error)
                                          }

                                            GetAttributeValuesAPIClient is a client that implements the GetAttributeValues operation.

                                            type GetAttributeValuesInput

                                            type GetAttributeValuesInput struct {
                                            
                                            	// The name of the attribute that you want to retrieve the values for, such as
                                            	// volumeType.
                                            	//
                                            	// This member is required.
                                            	AttributeName *string
                                            
                                            	// The service code for the service whose attributes you want to retrieve. For
                                            	// example, if you want the retrieve an EC2 attribute, use AmazonEC2.
                                            	//
                                            	// This member is required.
                                            	ServiceCode *string
                                            
                                            	// The maximum number of results to return in response.
                                            	MaxResults int32
                                            
                                            	// The pagination token that indicates the next set of results that you want to
                                            	// retrieve.
                                            	NextToken *string
                                            }

                                            type GetAttributeValuesOutput

                                            type GetAttributeValuesOutput struct {
                                            
                                            	// The list of values for an attribute. For example, Throughput Optimized HDD and
                                            	// Provisioned IOPS are two available values for the AmazonEC2volumeType.
                                            	AttributeValues []types.AttributeValue
                                            
                                            	// The pagination token that indicates the next set of results to retrieve.
                                            	NextToken *string
                                            
                                            	// Metadata pertaining to the operation's result.
                                            	ResultMetadata middleware.Metadata
                                            }

                                            type GetAttributeValuesPaginator

                                            type GetAttributeValuesPaginator struct {
                                            	// contains filtered or unexported fields
                                            }

                                              GetAttributeValuesPaginator is a paginator for GetAttributeValues

                                              func NewGetAttributeValuesPaginator

                                              func NewGetAttributeValuesPaginator(client GetAttributeValuesAPIClient, params *GetAttributeValuesInput, optFns ...func(*GetAttributeValuesPaginatorOptions)) *GetAttributeValuesPaginator

                                                NewGetAttributeValuesPaginator returns a new GetAttributeValuesPaginator

                                                func (*GetAttributeValuesPaginator) HasMorePages

                                                func (p *GetAttributeValuesPaginator) HasMorePages() bool

                                                  HasMorePages returns a boolean indicating whether more pages are available

                                                  func (*GetAttributeValuesPaginator) NextPage

                                                  func (p *GetAttributeValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAttributeValuesOutput, error)

                                                    NextPage retrieves the next GetAttributeValues page.

                                                    type GetAttributeValuesPaginatorOptions

                                                    type GetAttributeValuesPaginatorOptions struct {
                                                    	// The maximum number of results to return in response.
                                                    	Limit int32
                                                    
                                                    	// Set to true if pagination should stop if the service returns a pagination token
                                                    	// that matches the most recent token provided to the service.
                                                    	StopOnDuplicateToken bool
                                                    }

                                                      GetAttributeValuesPaginatorOptions is the paginator options for GetAttributeValues

                                                      type GetProductsAPIClient

                                                      type GetProductsAPIClient interface {
                                                      	GetProducts(context.Context, *GetProductsInput, ...func(*Options)) (*GetProductsOutput, error)
                                                      }

                                                        GetProductsAPIClient is a client that implements the GetProducts operation.

                                                        type GetProductsInput

                                                        type GetProductsInput struct {
                                                        
                                                        	// The list of filters that limit the returned products. only products that match
                                                        	// all filters are returned.
                                                        	Filters []types.Filter
                                                        
                                                        	// The format version that you want the response to be in. Valid values are: aws_v1
                                                        	FormatVersion *string
                                                        
                                                        	// The maximum number of results to return in the response.
                                                        	MaxResults int32
                                                        
                                                        	// The pagination token that indicates the next set of results that you want to
                                                        	// retrieve.
                                                        	NextToken *string
                                                        
                                                        	// The code for the service whose products you want to retrieve.
                                                        	ServiceCode *string
                                                        }

                                                        type GetProductsOutput

                                                        type GetProductsOutput struct {
                                                        
                                                        	// The format version of the response. For example, aws_v1.
                                                        	FormatVersion *string
                                                        
                                                        	// The pagination token that indicates the next set of results to retrieve.
                                                        	NextToken *string
                                                        
                                                        	// The list of products that match your filters. The list contains both the product
                                                        	// metadata and the price information.
                                                        	PriceList []string
                                                        
                                                        	// Metadata pertaining to the operation's result.
                                                        	ResultMetadata middleware.Metadata
                                                        }

                                                        type GetProductsPaginator

                                                        type GetProductsPaginator struct {
                                                        	// contains filtered or unexported fields
                                                        }

                                                          GetProductsPaginator is a paginator for GetProducts

                                                          func NewGetProductsPaginator

                                                          func NewGetProductsPaginator(client GetProductsAPIClient, params *GetProductsInput, optFns ...func(*GetProductsPaginatorOptions)) *GetProductsPaginator

                                                            NewGetProductsPaginator returns a new GetProductsPaginator

                                                            func (*GetProductsPaginator) HasMorePages

                                                            func (p *GetProductsPaginator) HasMorePages() bool

                                                              HasMorePages returns a boolean indicating whether more pages are available

                                                              func (*GetProductsPaginator) NextPage

                                                              func (p *GetProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetProductsOutput, error)

                                                                NextPage retrieves the next GetProducts page.

                                                                type GetProductsPaginatorOptions

                                                                type GetProductsPaginatorOptions struct {
                                                                	// The maximum number of results to return in the response.
                                                                	Limit int32
                                                                
                                                                	// Set to true if pagination should stop if the service returns a pagination token
                                                                	// that matches the most recent token provided to the service.
                                                                	StopOnDuplicateToken bool
                                                                }

                                                                  GetProductsPaginatorOptions is the paginator options for GetProducts

                                                                  type HTTPClient

                                                                  type HTTPClient interface {
                                                                  	Do(*http.Request) (*http.Response, error)
                                                                  }

                                                                  type HTTPSignerV4

                                                                  type HTTPSignerV4 interface {
                                                                  	SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
                                                                  }

                                                                  type Options

                                                                  type Options struct {
                                                                  	// Set of options to modify how an operation is invoked. These apply to all
                                                                  	// operations invoked for this client. Use functional options on operation call to
                                                                  	// modify this list for per operation behavior.
                                                                  	APIOptions []func(*middleware.Stack) error
                                                                  
                                                                  	// Configures the events that will be sent to the configured logger.
                                                                  	ClientLogMode aws.ClientLogMode
                                                                  
                                                                  	// The credentials object to use when signing requests.
                                                                  	Credentials aws.CredentialsProvider
                                                                  
                                                                  	// The endpoint options to be used when attempting to resolve an endpoint.
                                                                  	EndpointOptions EndpointResolverOptions
                                                                  
                                                                  	// The service endpoint resolver.
                                                                  	EndpointResolver EndpointResolver
                                                                  
                                                                  	// Signature Version 4 (SigV4) Signer
                                                                  	HTTPSignerV4 HTTPSignerV4
                                                                  
                                                                  	// The logger writer interface to write logging messages to.
                                                                  	Logger logging.Logger
                                                                  
                                                                  	// The region to send requests to. (Required)
                                                                  	Region string
                                                                  
                                                                  	// Retryer guides how HTTP requests should be retried in case of recoverable
                                                                  	// failures. When nil the API client will use a default retryer.
                                                                  	Retryer aws.Retryer
                                                                  
                                                                  	// The HTTP client to invoke API calls with. Defaults to client's default HTTP
                                                                  	// implementation if nil.
                                                                  	HTTPClient HTTPClient
                                                                  }

                                                                  func (Options) Copy

                                                                  func (o Options) Copy() Options

                                                                    Copy creates a clone where the APIOptions list is deep copied.

                                                                    type ResolveEndpoint

                                                                    type ResolveEndpoint struct {
                                                                    	Resolver EndpointResolver
                                                                    	Options  EndpointResolverOptions
                                                                    }

                                                                    func (*ResolveEndpoint) HandleSerialize

                                                                    func (*ResolveEndpoint) ID

                                                                    func (*ResolveEndpoint) ID() string

                                                                    Directories

                                                                    Path Synopsis
                                                                    internal