pricing

package module
v1.19.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 32 Imported by: 49

Documentation

Overview

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

Amazon Web Services Price List API is a centralized and convenient way to programmatically query Amazon Web Services for services, products, and pricing information. The Amazon Web Services Price List uses standardized product attributes such as Location , Storage Class , and Operating System , and provides prices at the SKU level. You can use the Amazon Web Services Price List 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 Amazon Web Services. Use GetServices without a service code to retrieve the service codes for all AWS services, then GetServices with a service code to retrieve 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 IOPS volumeType . Service Endpoint Amazon Web Services Price List service API provides the following two endpoints:

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 added in v1.0.0

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. Attributes 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 Billing and Cost Management User Guide (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html) .

func (*Client) GetPriceListFileUrl added in v1.19.0

func (c *Client) GetPriceListFileUrl(ctx context.Context, params *GetPriceListFileUrlInput, optFns ...func(*Options)) (*GetPriceListFileUrlOutput, error)

This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (https://aws.amazon.com/service-terms/) (Section 1.10). This returns the URL that you can retrieve your Price List file from. This URL is based on the PriceListArn and FileFormat that you retrieve from the ListPriceLists (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html) response.

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.

func (*Client) ListPriceLists added in v1.19.0

func (c *Client) ListPriceLists(ctx context.Context, params *ListPriceListsInput, optFns ...func(*Options)) (*ListPriceListsOutput, error)

This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the Amazon Web Services Service Terms (https://aws.amazon.com/service-terms/) (Section 1.10). This returns a list of Price List references that the requester if authorized to view, given a ServiceCode , CurrencyCode , and an EffectiveDate . Use without a RegionCode filter to list Price List references from all available Amazon Web Services Regions. Use with a RegionCode filter to get the Price List reference that's specific to a specific Amazon Web Services Region. You can use the PriceListArn from the response to get your preferred Price List files through the GetPriceListFileUrl (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetPriceListFileUrl.html) API.

type DescribeServicesAPIClient added in v0.30.0

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
	// contains filtered or unexported fields
}

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 retrievable 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
	// contains filtered or unexported fields
}

type DescribeServicesPaginator added in v0.30.0

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

DescribeServicesPaginator is a paginator for DescribeServices

func NewDescribeServicesPaginator added in v0.30.0

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

NewDescribeServicesPaginator returns a new DescribeServicesPaginator

func (*DescribeServicesPaginator) HasMorePages added in v0.30.0

func (p *DescribeServicesPaginator) HasMorePages() bool

HasMorePages returns a boolean indicating whether more pages are available

func (*DescribeServicesPaginator) NextPage added in v0.30.0

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

NextPage retrieves the next DescribeServices page.

type DescribeServicesPaginatorOptions added in v0.30.0

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 added in v1.1.0

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 added in v0.29.0

type EndpointResolverOptions = internalendpoints.Options

EndpointResolverOptions is the service endpoint resolver options

type GetAttributeValuesAPIClient added in v0.30.0

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
	// contains filtered or unexported fields
}

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 AmazonEC2 volumeType .
	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
	// contains filtered or unexported fields
}

type GetAttributeValuesPaginator added in v0.30.0

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

GetAttributeValuesPaginator is a paginator for GetAttributeValues

func NewGetAttributeValuesPaginator added in v0.30.0

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

NewGetAttributeValuesPaginator returns a new GetAttributeValuesPaginator

func (*GetAttributeValuesPaginator) HasMorePages added in v0.30.0

func (p *GetAttributeValuesPaginator) HasMorePages() bool

HasMorePages returns a boolean indicating whether more pages are available

func (*GetAttributeValuesPaginator) NextPage added in v0.30.0

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

NextPage retrieves the next GetAttributeValues page.

type GetAttributeValuesPaginatorOptions added in v0.30.0

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 GetPriceListFileUrlInput added in v1.19.0

type GetPriceListFileUrlInput struct {

	// The format that you want to retrieve your Price List files in. The FileFormat
	// can be obtained from the ListPriceLists (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html)
	// response.
	//
	// This member is required.
	FileFormat *string

	// The unique identifier that maps to where your Price List files are located.
	// PriceListArn can be obtained from the ListPriceLists (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html)
	// response.
	//
	// This member is required.
	PriceListArn *string
	// contains filtered or unexported fields
}

type GetPriceListFileUrlOutput added in v1.19.0

type GetPriceListFileUrlOutput struct {

	// The URL to download your Price List file from.
	Url *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
	// contains filtered or unexported fields
}

type GetProductsAPIClient added in v0.30.0

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 code for the service whose products you want to retrieve.
	//
	// This member is required.
	ServiceCode *string

	// 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
	// contains filtered or unexported fields
}

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
	// contains filtered or unexported fields
}

type GetProductsPaginator added in v0.30.0

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

GetProductsPaginator is a paginator for GetProducts

func NewGetProductsPaginator added in v0.30.0

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

NewGetProductsPaginator returns a new GetProductsPaginator

func (*GetProductsPaginator) HasMorePages added in v0.30.0

func (p *GetProductsPaginator) HasMorePages() bool

HasMorePages returns a boolean indicating whether more pages are available

func (*GetProductsPaginator) NextPage added in v0.30.0

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

NextPage retrieves the next GetProducts page.

type GetProductsPaginatorOptions added in v0.30.0

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 ListPriceListsAPIClient added in v1.19.0

type ListPriceListsAPIClient interface {
	ListPriceLists(context.Context, *ListPriceListsInput, ...func(*Options)) (*ListPriceListsOutput, error)
}

ListPriceListsAPIClient is a client that implements the ListPriceLists operation.

type ListPriceListsInput added in v1.19.0

type ListPriceListsInput struct {

	// The three alphabetical character ISO-4217 currency code that the Price List
	// files are denominated in.
	//
	// This member is required.
	CurrencyCode *string

	// The date that the Price List file prices are effective from.
	//
	// This member is required.
	EffectiveDate *time.Time

	// The service code or the Savings Plan service code for the attributes that you
	// want to retrieve. For example, to get the list of applicable Amazon EC2 price
	// lists, use AmazonEC2 . For a full list of service codes containing On-Demand and
	// Reserved Instance (RI) pricing, use the DescribeServices (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_DescribeServices.html#awscostmanagement-pricing_DescribeServices-request-FormatVersion)
	// API. To retrieve the Compute Savings Plan price lists, use ComputeSavingsPlans .
	// To retrieve Machine Learning Savings Plans price lists, use
	// MachineLearningSavingsPlans .
	//
	// This member is required.
	ServiceCode *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

	// This is used to filter the Price List by Amazon Web Services Region. For
	// example, to get the price list only for the US East (N. Virginia) Region, use
	// us-east-1 . If nothing is specified, you retrieve price lists for all applicable
	// Regions. The available RegionCode list can be retrieved from GetAttributeValues (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html)
	// API.
	RegionCode *string
	// contains filtered or unexported fields
}

type ListPriceListsOutput added in v1.19.0

type ListPriceListsOutput struct {

	// The pagination token that indicates the next set of results to retrieve.
	NextToken *string

	// The type of price list references that match your request.
	PriceLists []types.PriceList

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
	// contains filtered or unexported fields
}

type ListPriceListsPaginator added in v1.19.0

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

ListPriceListsPaginator is a paginator for ListPriceLists

func NewListPriceListsPaginator added in v1.19.0

func NewListPriceListsPaginator(client ListPriceListsAPIClient, params *ListPriceListsInput, optFns ...func(*ListPriceListsPaginatorOptions)) *ListPriceListsPaginator

NewListPriceListsPaginator returns a new ListPriceListsPaginator

func (*ListPriceListsPaginator) HasMorePages added in v1.19.0

func (p *ListPriceListsPaginator) HasMorePages() bool

HasMorePages returns a boolean indicating whether more pages are available

func (*ListPriceListsPaginator) NextPage added in v1.19.0

func (p *ListPriceListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPriceListsOutput, error)

NextPage retrieves the next ListPriceLists page.

type ListPriceListsPaginatorOptions added in v1.19.0

type ListPriceListsPaginatorOptions 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
}

ListPriceListsPaginatorOptions is the paginator options for ListPriceLists

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 configuration DefaultsMode that the SDK should use when constructing the
	// clients initial default settings.
	DefaultsMode aws.DefaultsMode

	// 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

	// RetryMaxAttempts specifies the maximum number attempts an API client will call
	// an operation that fails with a retryable error. A value of 0 is ignored, and
	// will not be used to configure the API client created default retryer, or modify
	// per operation call's retry max attempts. When creating a new API Clients this
	// member will only be used if the Retryer Options member is nil. This value will
	// be ignored if Retryer is not nil. If specified in an operation call's functional
	// options with a value that is different than the constructed client's Options,
	// the Client's Retryer will be wrapped to use the operation's specific
	// RetryMaxAttempts value.
	RetryMaxAttempts int

	// RetryMode specifies the retry mode the API client will be created with, if
	// Retryer option is not also specified. When creating a new API Clients this
	// member will only be used if the Retryer Options member is nil. This value will
	// be ignored if Retryer is not nil. Currently does not support per operation call
	// overrides, may in the future.
	RetryMode aws.RetryMode

	// Retryer guides how HTTP requests should be retried in case of recoverable
	// failures. When nil the API client will use a default retryer. The kind of
	// default retry created by the API client can be changed with the RetryMode
	// option.
	Retryer aws.Retryer

	// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
	// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
	// should not populate this structure programmatically, or rely on the values here
	// within your applications.
	RuntimeEnvironment aws.RuntimeEnvironment

	// The HTTP client to invoke API calls with. Defaults to client's default HTTP
	// implementation if nil.
	HTTPClient HTTPClient
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL