costexplorer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package costexplorer provides the client and types for making API requests to AWS Cost Explorer Service.

The Cost Explorer API allows you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for DynamoDB database tables in your production environment.

Service Endpoint

The Cost Explorer API provides the following endpoint:

See https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25 for more information on this service.

See costexplorer package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/costexplorer/

Using the Client

To AWS Cost Explorer Service with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the AWS Cost Explorer Service client CostExplorer for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/costexplorer/#New

Index

Constants

View Source
const (
	ServiceName = "ce"        // Service endpoint prefix API calls made to.
	EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)

Service information constants

View Source
const (

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// You made too many calls in a short period of time. Try again later.
	ErrCodeLimitExceededException = "LimitExceededException"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context string
const (
	ContextCostAndUsage Context = "COST_AND_USAGE"
	ContextReservations Context = "RESERVATIONS"
)

Enum values for Context

type CostExplorer

type CostExplorer struct {
	*aws.Client
}

CostExplorer provides the API operation methods for making requests to AWS Cost Explorer Service. See this package's package overview docs for details on the service.

CostExplorer methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(config aws.Config) *CostExplorer

New creates a new instance of the CostExplorer client with a config. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

// Create a CostExplorer client from just a config.
svc := costexplorer.New(myConfig)

// Create a CostExplorer client with additional configuration
svc := costexplorer.New(myConfig, aws.NewConfig().WithRegion("us-west-2"))

func (*CostExplorer) GetCostAndUsageRequest

func (c *CostExplorer) GetCostAndUsageRequest(input *GetCostAndUsageInput) GetCostAndUsageRequest

GetCostAndUsageRequest returns a request value for making API operation for AWS Cost Explorer Service.

Retrieve cost and usage metrics for your account. You can specify which cost and usage-related metric, such as BlendedCosts or UsageQuantity, that you want the request to return. You can also filter and group your data by various dimensions, such as AWS Service or AvailabilityZone, in a specific time range. See the GetDimensionValues action for a complete list of the valid dimensions. Master accounts in an organization have access to all member accounts.

// Example sending a request using the GetCostAndUsageRequest method.
req := client.GetCostAndUsageRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsage

func (*CostExplorer) GetDimensionValuesRequest

func (c *CostExplorer) GetDimensionValuesRequest(input *GetDimensionValuesInput) GetDimensionValuesRequest

GetDimensionValuesRequest returns a request value for making API operation for AWS Cost Explorer Service.

You can use GetDimensionValues to retrieve all available filter values for a specific filter over a period of time. You can search the dimension values for an arbitrary string.

// Example sending a request using the GetDimensionValuesRequest method.
req := client.GetDimensionValuesRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValues

func (*CostExplorer) GetReservationUtilizationRequest

func (c *CostExplorer) GetReservationUtilizationRequest(input *GetReservationUtilizationInput) GetReservationUtilizationRequest

GetReservationUtilizationRequest returns a request value for making API operation for AWS Cost Explorer Service.

You can retrieve the Reservation utilization for your account. Master accounts in an organization have access to their associated member accounts. You can filter data by dimensions in a time period. You can use GetDimensionValues to determine the possible dimension values. Currently, you can group only by SUBSCRIPTION_ID.

// Example sending a request using the GetReservationUtilizationRequest method.
req := client.GetReservationUtilizationRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilization

func (*CostExplorer) GetTagsRequest

func (c *CostExplorer) GetTagsRequest(input *GetTagsInput) GetTagsRequest

GetTagsRequest returns a request value for making API operation for AWS Cost Explorer Service.

You can query for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.

// Example sending a request using the GetTagsRequest method.
req := client.GetTagsRequest(params)
resp, err := req.Send()
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetTags

type DateInterval

type DateInterval struct {

	// The end of the time period that you want the usage and costs for. The end
	// date is exclusive. For example, if the end is 2017-05-01, then the cost and
	// usage data is retrieved from the start date but not including 2017-05-01.
	//
	// End is a required field
	End *string `type:"string" required:"true"`

	// The beginning of the time period that you want the usage and costs for. The
	// start date is inclusive. For example, if start is 2017-01-01, then the cost
	// and usage data is retrieved starting at 2017-01-01 up to the end date.
	//
	// Start is a required field
	Start *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

The time period that you want the usage and costs for. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/DateInterval

func (DateInterval) GoString

func (s DateInterval) GoString() string

GoString returns the string representation

func (*DateInterval) SetEnd

func (s *DateInterval) SetEnd(v string) *DateInterval

SetEnd sets the End field's value.

func (*DateInterval) SetStart

func (s *DateInterval) SetStart(v string) *DateInterval

SetStart sets the Start field's value.

func (DateInterval) String

func (s DateInterval) String() string

String returns the string representation

func (*DateInterval) Validate

func (s *DateInterval) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type Dimension

type Dimension string
const (
	DimensionAz              Dimension = "AZ"
	DimensionInstanceType    Dimension = "INSTANCE_TYPE"
	DimensionLinkedAccount   Dimension = "LINKED_ACCOUNT"
	DimensionOperation       Dimension = "OPERATION"
	DimensionPurchaseType    Dimension = "PURCHASE_TYPE"
	DimensionRegion          Dimension = "REGION"
	DimensionService         Dimension = "SERVICE"
	DimensionUsageType       Dimension = "USAGE_TYPE"
	DimensionUsageTypeGroup  Dimension = "USAGE_TYPE_GROUP"
	DimensionRecordType      Dimension = "RECORD_TYPE"
	DimensionOperatingSystem Dimension = "OPERATING_SYSTEM"
	DimensionTenancy         Dimension = "TENANCY"
	DimensionScope           Dimension = "SCOPE"
	DimensionPlatform        Dimension = "PLATFORM"
	DimensionSubscriptionId  Dimension = "SUBSCRIPTION_ID"
)

Enum values for Dimension

type DimensionValues

type DimensionValues struct {

	// The names of the metadata types that you can use to filter and group your
	// results. For example, AZ returns a list of Availability Zones.
	Key Dimension `type:"string" enum:"true"`

	// The metadata values that you can use to filter and group your results. You
	// can use GetDimensionValues to find specific values.
	Values []string `type:"list"`
	// contains filtered or unexported fields
}

The metadata that you can use to filter and group your results. You can use GetDimensionValues to find specific values. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/DimensionValues

func (DimensionValues) GoString

func (s DimensionValues) GoString() string

GoString returns the string representation

func (*DimensionValues) SetKey

SetKey sets the Key field's value.

func (*DimensionValues) SetValues

func (s *DimensionValues) SetValues(v []string) *DimensionValues

SetValues sets the Values field's value.

func (DimensionValues) String

func (s DimensionValues) String() string

String returns the string representation

type DimensionValuesWithAttributes

type DimensionValuesWithAttributes struct {

	// The attribute that applies to a specific Dimension.
	Attributes map[string]string `type:"map"`

	// The value of a dimension with a specific attribute.
	Value *string `type:"string"`
	// contains filtered or unexported fields
}

The metadata of a specific type that you can use to filter and group your results. You can use GetDimensionValues to find specific values. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/DimensionValuesWithAttributes

func (DimensionValuesWithAttributes) GoString

GoString returns the string representation

func (*DimensionValuesWithAttributes) SetAttributes

SetAttributes sets the Attributes field's value.

func (*DimensionValuesWithAttributes) SetValue

SetValue sets the Value field's value.

func (DimensionValuesWithAttributes) String

String returns the string representation

type Expression

type Expression struct {

	// Return results that match both Dimension objects.
	And []Expression `type:"list"`

	// The specific Dimension to use for Expression.
	Dimensions *DimensionValues `type:"structure"`

	// Return results that don't match Dimension.
	Not *Expression `type:"structure"`

	// Return results that match either Dimension.
	Or []Expression `type:"list"`

	// The specific Tag to use for Expression.
	Tags *TagValues `type:"structure"`
	// contains filtered or unexported fields
}

Use Expression to filter by cost or by usage. There are two patterns:

  • Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for InstanceType==m4.xlarge OR InstanceType==c4.large. The Expression for that looks like this.

{ "Dimensions": { "Key": "InstanceType", "Values": [ "m4.xlarge", “c4.large”

] } }

The list of dimension values are OR'd together to retrieve cost or usage

data. You can create Expression and DimensionValues objects using either
with* methods or set* methods in multiple lines.

* Compound dimension values with logical operations - You can use multiple
Expression types and the logical operators AND/OR/NOT to create a list
of one or more Expression objects. This allows you to filter on more advanced
options. For example, you can filter on ((InstanceType == m4.large OR
InstanceType == m3.large) OR (Tag.Type == Type1)) AND (UsageType != DataTransfer).
The Expression for that looks like this.

{ "And": [ {"Or": [ {"Dimensions": { "Key": "InstanceType", "Values": [ "m4.x.large",

"c4.large" ] }}, {"Tag": { "Key": "TagName", "Values": ["Value1"] } }
]}, {"Not": {"dimensions": { "Key": "UsageType", "Values": ["DataTransfer"]
}}} ] }

Because each Expression can have only one operator, the service returns an

  error if more than one is specified. The following example shows an Expression
  object that will create an error.

{ "And": [ ... ], "DimensionValues": { "Dimension": "UsageType", "Values":
  [ "DataTransfer" ] } }

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/Expression

func (Expression) GoString

func (s Expression) GoString() string

GoString returns the string representation

func (*Expression) SetAnd

func (s *Expression) SetAnd(v []Expression) *Expression

SetAnd sets the And field's value.

func (*Expression) SetDimensions

func (s *Expression) SetDimensions(v *DimensionValues) *Expression

SetDimensions sets the Dimensions field's value.

func (*Expression) SetNot

func (s *Expression) SetNot(v *Expression) *Expression

SetNot sets the Not field's value.

func (*Expression) SetOr

func (s *Expression) SetOr(v []Expression) *Expression

SetOr sets the Or field's value.

func (*Expression) SetTags

func (s *Expression) SetTags(v *TagValues) *Expression

SetTags sets the Tags field's value.

func (Expression) String

func (s Expression) String() string

String returns the string representation

type GetCostAndUsageInput

type GetCostAndUsageInput struct {

	// Filters AWS costs by different dimensions. For example, you can specify Service
	// and Linked Account and get the costs associated with that account's usage
	// of that service. You can nest Expression objects to define any combination
	// of dimension filters. For more information, see the Expression object or
	// More Examples.
	Filter *Expression `type:"structure"`

	// Sets the AWS cost granularity to MONTHLY or DAILY.
	Granularity Granularity `type:"string" enum:"true"`

	// You can group AWS costs using up to two different groups, either dimensions,
	// tag keys, or both.
	//
	// When you group by tag key, you get all tag values, including empty strings.
	//
	// Valid values are: AZ, INSTANCE_TYPE, LINKED_ACCCOUNT, OPERATION, PURCHASE_TYPE,
	// SERVICE, USAGE_TYPE, TAGS, and PLATFORM.
	GroupBy []GroupDefinition `type:"list"`

	// Which metrics are returned in the query. For more information about blended
	// and unblended rates, see https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/.
	//
	// Valid values are BlendedCost, UnblendedCost, and UsageQuantity.
	//
	// If you return the UsageQuantity metric, the service aggregates all usage
	// numbers without taking into account the units. For example, if you aggregate
	// usageQuantity across all of EC2, the results aren't meaningful because EC2
	// compute hours and data transfer are measured in different units (for example,
	// hours vs. GB). To get more meaningful UsageQuantity metrics, filter by UsageType
	// or UsageTypeGroups.
	Metrics []string `type:"list"`

	// The token to retrieve the next set of results. AWS provides the token when
	// the response from a previous call has more results than the maximum page
	// size.
	NextPageToken *string `type:"string"`

	// Sets the start and end dates for retrieving AWS costs. The start date is
	// inclusive, but the end date is exclusive. For example, if start is 2017-01-01
	// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
	// up to and including 2017-04-30 but not including 2017-05-01.
	TimePeriod *DateInterval `type:"structure"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsageRequest

func (GetCostAndUsageInput) GoString

func (s GetCostAndUsageInput) GoString() string

GoString returns the string representation

func (*GetCostAndUsageInput) SetFilter

SetFilter sets the Filter field's value.

func (*GetCostAndUsageInput) SetGranularity

SetGranularity sets the Granularity field's value.

func (*GetCostAndUsageInput) SetGroupBy

SetGroupBy sets the GroupBy field's value.

func (*GetCostAndUsageInput) SetMetrics

func (s *GetCostAndUsageInput) SetMetrics(v []string) *GetCostAndUsageInput

SetMetrics sets the Metrics field's value.

func (*GetCostAndUsageInput) SetNextPageToken

func (s *GetCostAndUsageInput) SetNextPageToken(v string) *GetCostAndUsageInput

SetNextPageToken sets the NextPageToken field's value.

func (*GetCostAndUsageInput) SetTimePeriod

SetTimePeriod sets the TimePeriod field's value.

func (GetCostAndUsageInput) String

func (s GetCostAndUsageInput) String() string

String returns the string representation

func (*GetCostAndUsageInput) Validate

func (s *GetCostAndUsageInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetCostAndUsageOutput

type GetCostAndUsageOutput struct {

	// The groups specified by the the Filter or GroupBy parameters in the request.
	GroupDefinitions []GroupDefinition `type:"list"`

	// The token for the next set of retrievable results. AWS provides the token
	// when the response from a previous call has more results than the maximum
	// page size.
	NextPageToken *string `type:"string"`

	// The time period covered by the results in the response.
	ResultsByTime []ResultByTime `type:"list"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsageResponse

func (GetCostAndUsageOutput) GoString

func (s GetCostAndUsageOutput) GoString() string

GoString returns the string representation

func (GetCostAndUsageOutput) SDKResponseMetadata

func (s GetCostAndUsageOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (*GetCostAndUsageOutput) SetGroupDefinitions

func (s *GetCostAndUsageOutput) SetGroupDefinitions(v []GroupDefinition) *GetCostAndUsageOutput

SetGroupDefinitions sets the GroupDefinitions field's value.

func (*GetCostAndUsageOutput) SetNextPageToken

func (s *GetCostAndUsageOutput) SetNextPageToken(v string) *GetCostAndUsageOutput

SetNextPageToken sets the NextPageToken field's value.

func (*GetCostAndUsageOutput) SetResultsByTime

func (s *GetCostAndUsageOutput) SetResultsByTime(v []ResultByTime) *GetCostAndUsageOutput

SetResultsByTime sets the ResultsByTime field's value.

func (GetCostAndUsageOutput) String

func (s GetCostAndUsageOutput) String() string

String returns the string representation

type GetCostAndUsageRequest

type GetCostAndUsageRequest struct {
	*aws.Request
	Input *GetCostAndUsageInput
}

GetCostAndUsageRequest is a API request type for the GetCostAndUsage API operation.

func (GetCostAndUsageRequest) Send

Send marshals and sends the GetCostAndUsage API request.

type GetDimensionValuesInput

type GetDimensionValuesInput struct {

	// The context for the call to GetDimensionValues. This can be RESERVED_INSTANCE
	// or COST_AND_USAGE. The default value is COST_AND_USAGE. If the context is
	// set to RESERVED_INSTANCE, the resulting dimension values can be used in the
	// GetReservationUtilization action. If the context is set to COST_AND_USAGE,
	// , the resulting dimension values can be used in the GetCostAndUsage operation.
	//
	// If you set the context to CostAndUsage, you can use the following dimensions
	// for searching:
	//
	//    * AZ - The Availability Zone. An example is us-east-1a.
	//
	//    * InstanceType - The type of EC2 instance. An example is m4.xlarge.
	//
	//    * LinkedAccount - The description in the attribute map that includes the
	//    full name of the member account. The value field contains the AWS ID of
	//    the member account
	//
	//    * Operation - The action performed. Examples include RunInstance and CreateBucket.
	//
	//    * PurchaseType - The reservation type of the purchase to which this usage
	//    is related. Examples include: On Demand Instances and Standard Reserved
	//    Instances
	//
	//    * Service - The AWS service such as DynamoDB.
	//
	//    * UsageType -The type of usage. An example is DataTransfer-In-Bytes. The
	//    response for the GetDimensionValues action includes a unit attribute,
	//    examples of which include GB and Hrs.
	//
	//    * UsageTypeGroup - The grouping of common usage types. An example is EC2:
	//    CloudWatch – Alarms. The response for this action includes a unit attribute.
	//
	//    * RecordType - The different types of charges such as RI fees, usage costs,
	//    tax refunds, and credits
	//
	// If you set the context to ReservedInstance, you can use the following dimensions
	// for searching:
	//
	//    * AZ - The Availability Zone. An example is us-east-1a.
	//
	//    * InstanceType - The type of EC2 instance. An example is m4.xlarge.
	//
	//    * LinkedAccount - The description in the attribute map that includes the
	//    full name of the member account. The value field contains the AWS ID of
	//    the member account
	//
	//    * Platform - The operating system. Examples are Windows or Linux.
	//
	//    * Region - The AWS region.
	//
	//    * Scope - The scope of a reserved instance (RI). Values are regional or
	//    a single availability zone.
	//
	//    * Tenancy - The tenancy of a resource. Examples are shared or dedicated.
	Context Context `type:"string" enum:"true"`

	// The name of the dimension. Different Dimensionsare available for different
	// Contexts. For more information, see Context.
	//
	// Dimension is a required field
	Dimension Dimension `type:"string" required:"true" enum:"true"`

	// The token to retrieve the next set of results. AWS provides the token when
	// the response from a previous call has more results than the maximum page
	// size.
	NextPageToken *string `type:"string"`

	// The value that you want to search the filter values for.
	SearchString *string `type:"string"`

	// The start and end dates for retrieving the dimension values. The start date
	// is inclusive, but the end date is exclusive. For example, if start is 2017-01-01
	// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
	// up to and including 2017-04-30 but not including 2017-05-01.
	//
	// TimePeriod is a required field
	TimePeriod *DateInterval `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValuesRequest

func (GetDimensionValuesInput) GoString

func (s GetDimensionValuesInput) GoString() string

GoString returns the string representation

func (*GetDimensionValuesInput) SetContext

SetContext sets the Context field's value.

func (*GetDimensionValuesInput) SetDimension

SetDimension sets the Dimension field's value.

func (*GetDimensionValuesInput) SetNextPageToken

func (s *GetDimensionValuesInput) SetNextPageToken(v string) *GetDimensionValuesInput

SetNextPageToken sets the NextPageToken field's value.

func (*GetDimensionValuesInput) SetSearchString

SetSearchString sets the SearchString field's value.

func (*GetDimensionValuesInput) SetTimePeriod

SetTimePeriod sets the TimePeriod field's value.

func (GetDimensionValuesInput) String

func (s GetDimensionValuesInput) String() string

String returns the string representation

func (*GetDimensionValuesInput) Validate

func (s *GetDimensionValuesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetDimensionValuesOutput

type GetDimensionValuesOutput struct {

	// The filters that you used to filter your request. Some dimensions are available
	// only for a specific context:
	//
	// If you set the context to CostAndUsage, you can use the following dimensions
	// for searching:
	//
	//    * AZ - The Availability Zone. An example is us-east-1a.
	//
	//    * InstanceType - The type of EC2 instance. An example is m4.xlarge.
	//
	//    * LinkedAccount - The description in the attribute map that includes the
	//    full name of the member account. The value field contains the AWS ID of
	//    the member account
	//
	//    * Operation - The action performed. Examples include RunInstance and CreateBucket.
	//
	//    * PurchaseType - The reservation type of the purchase to which this usage
	//    is related. Examples include: On Demand Instances and Standard Reserved
	//    Instances
	//
	//    * Service - The AWS service such as DynamoDB.
	//
	//    * UsageType -The type of usage. An example is DataTransfer-In-Bytes. The
	//    response for the GetDimensionValues action includes a unit attribute,
	//    examples of which include GB and Hrs.
	//
	//    * UsageTypeGroup - The grouping of common usage types. An example is EC2:
	//    CloudWatch – Alarms. The response for this action includes a unit attribute.
	//
	//    * RecordType - The different types of charges such as RI fees, usage costs,
	//    tax refunds, and credits
	//
	// If you set the context to ReservedInstance, you can use the following dimensions
	// for searching:
	//
	//    * AZ - The Availability Zone. An example is us-east-1a.
	//
	//    * InstanceType - The type of EC2 instance. An example is m4.xlarge.
	//
	//    * LinkedAccount - The description in the attribute map that includes the
	//    full name of the member account. The value field contains the AWS ID of
	//    the member account
	//
	//    * Platform - The operating system. Examples are Windows or Linux.
	//
	//    * Region - The AWS region.
	//
	//    * Scope - The scope of a reserved instance (RI). Values are regional or
	//    a single availability zone.
	//
	//    * Tenancy - The tenancy of a resource. Examples are shared or dedicated.
	//
	// DimensionValues is a required field
	DimensionValues []DimensionValuesWithAttributes `type:"list" required:"true"`

	// The token for the next set of retrievable results. AWS provides the token
	// when the response from a previous call has more results than the maximum
	// page size.
	NextPageToken *string `type:"string"`

	// The number of results that AWS returned at one time.
	//
	// ReturnSize is a required field
	ReturnSize *int64 `type:"integer" required:"true"`

	// The total number of search results.
	//
	// TotalSize is a required field
	TotalSize *int64 `type:"integer" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValuesResponse

func (GetDimensionValuesOutput) GoString

func (s GetDimensionValuesOutput) GoString() string

GoString returns the string representation

func (GetDimensionValuesOutput) SDKResponseMetadata

func (s GetDimensionValuesOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (*GetDimensionValuesOutput) SetDimensionValues

SetDimensionValues sets the DimensionValues field's value.

func (*GetDimensionValuesOutput) SetNextPageToken

SetNextPageToken sets the NextPageToken field's value.

func (*GetDimensionValuesOutput) SetReturnSize

SetReturnSize sets the ReturnSize field's value.

func (*GetDimensionValuesOutput) SetTotalSize

SetTotalSize sets the TotalSize field's value.

func (GetDimensionValuesOutput) String

func (s GetDimensionValuesOutput) String() string

String returns the string representation

type GetDimensionValuesRequest

type GetDimensionValuesRequest struct {
	*aws.Request
	Input *GetDimensionValuesInput
}

GetDimensionValuesRequest is a API request type for the GetDimensionValues API operation.

func (GetDimensionValuesRequest) Send

Send marshals and sends the GetDimensionValues API request.

type GetReservationUtilizationInput

type GetReservationUtilizationInput struct {

	// Filters utilization data by using different dimensions. GetReservationUtilization
	// uses the same Expression object as the other operations, but only AND is
	// supported among each dimension, and nesting is supported up to only one level
	// deep. If there are multiple values for a dimension, they are OR'd together.
	Filter *Expression `type:"structure"`

	// Sets the AWS cost granularity to MONTHLY or DAILY. If both GroupBy and granularity
	// are not set, GetReservationUtilization defaults to DAILY. If GroupBy is set,
	// Granularity can't be set, and the response object doesn't include MONTHLY
	// or DAILY granularity.
	Granularity Granularity `type:"string" enum:"true"`

	// Groups only by SubscriptionId. Metadata is included.
	GroupBy []GroupDefinition `type:"list"`

	// The token to retrieve the next set of results. AWS provides the token when
	// the response from a previous call has more results than the maximum page
	// size.
	NextPageToken *string `type:"string"`

	// Sets the start and end dates for retrieving reserve instance (RI) utilization.
	// The start date is inclusive, but the end date is exclusive. For example,
	// if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data
	// is retrieved from 2017-01-01 up to and including 2017-04-30 but not including
	// 2017-05-01.
	//
	// TimePeriod is a required field
	TimePeriod *DateInterval `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilizationRequest

func (GetReservationUtilizationInput) GoString

GoString returns the string representation

func (*GetReservationUtilizationInput) SetFilter

SetFilter sets the Filter field's value.

func (*GetReservationUtilizationInput) SetGranularity

SetGranularity sets the Granularity field's value.

func (*GetReservationUtilizationInput) SetGroupBy

SetGroupBy sets the GroupBy field's value.

func (*GetReservationUtilizationInput) SetNextPageToken

SetNextPageToken sets the NextPageToken field's value.

func (*GetReservationUtilizationInput) SetTimePeriod

SetTimePeriod sets the TimePeriod field's value.

func (GetReservationUtilizationInput) String

String returns the string representation

func (*GetReservationUtilizationInput) Validate

func (s *GetReservationUtilizationInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetReservationUtilizationOutput

type GetReservationUtilizationOutput struct {

	// The token for the next set of retrievable results. AWS provides the token
	// when the response from a previous call has more results than the maximum
	// page size.
	NextPageToken *string `type:"string"`

	// The total amount of time that you utilized your RIs.
	Total *ReservationAggregates `type:"structure"`

	// The amount of time that you utilized your RIs.
	//
	// UtilizationsByTime is a required field
	UtilizationsByTime []UtilizationByTime `type:"list" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilizationResponse

func (GetReservationUtilizationOutput) GoString

GoString returns the string representation

func (GetReservationUtilizationOutput) SDKResponseMetadata

func (s GetReservationUtilizationOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (*GetReservationUtilizationOutput) SetNextPageToken

SetNextPageToken sets the NextPageToken field's value.

func (*GetReservationUtilizationOutput) SetTotal

SetTotal sets the Total field's value.

func (*GetReservationUtilizationOutput) SetUtilizationsByTime

SetUtilizationsByTime sets the UtilizationsByTime field's value.

func (GetReservationUtilizationOutput) String

String returns the string representation

type GetReservationUtilizationRequest

type GetReservationUtilizationRequest struct {
	*aws.Request
	Input *GetReservationUtilizationInput
}

GetReservationUtilizationRequest is a API request type for the GetReservationUtilization API operation.

func (GetReservationUtilizationRequest) Send

Send marshals and sends the GetReservationUtilization API request.

type GetTagsInput

type GetTagsInput struct {

	// The token to retrieve the next set of results. AWS provides the token when
	// the response from a previous call has more results than the maximum page
	// size.
	NextPageToken *string `type:"string"`

	// The value that you want to search for.
	SearchString *string `type:"string"`

	// The key of the tag that you want to return values for.
	TagKey *string `type:"string"`

	// The start and end dates for retrieving the dimension values. The start date
	// is inclusive, but the end date is exclusive. For example, if start is 2017-01-01
	// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
	// up to and including 2017-04-30 but not including 2017-05-01.
	//
	// TimePeriod is a required field
	TimePeriod *DateInterval `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetTagsRequest

func (GetTagsInput) GoString

func (s GetTagsInput) GoString() string

GoString returns the string representation

func (*GetTagsInput) SetNextPageToken

func (s *GetTagsInput) SetNextPageToken(v string) *GetTagsInput

SetNextPageToken sets the NextPageToken field's value.

func (*GetTagsInput) SetSearchString

func (s *GetTagsInput) SetSearchString(v string) *GetTagsInput

SetSearchString sets the SearchString field's value.

func (*GetTagsInput) SetTagKey

func (s *GetTagsInput) SetTagKey(v string) *GetTagsInput

SetTagKey sets the TagKey field's value.

func (*GetTagsInput) SetTimePeriod

func (s *GetTagsInput) SetTimePeriod(v *DateInterval) *GetTagsInput

SetTimePeriod sets the TimePeriod field's value.

func (GetTagsInput) String

func (s GetTagsInput) String() string

String returns the string representation

func (*GetTagsInput) Validate

func (s *GetTagsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetTagsOutput

type GetTagsOutput struct {

	// The token for the next set of retrievable results. AWS provides the token
	// when the response from a previous call has more results than the maximum
	// page size.
	NextPageToken *string `type:"string"`

	// The number of query results that AWS returns at a time.
	//
	// ReturnSize is a required field
	ReturnSize *int64 `type:"integer" required:"true"`

	// The tags that match your request.
	//
	// Tags is a required field
	Tags []string `type:"list" required:"true"`

	// The total number of query results.
	//
	// TotalSize is a required field
	TotalSize *int64 `type:"integer" required:"true"`
	// contains filtered or unexported fields
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetTagsResponse

func (GetTagsOutput) GoString

func (s GetTagsOutput) GoString() string

GoString returns the string representation

func (GetTagsOutput) SDKResponseMetadata

func (s GetTagsOutput) SDKResponseMetadata() aws.Response

SDKResponseMetdata return sthe response metadata for the API.

func (*GetTagsOutput) SetNextPageToken

func (s *GetTagsOutput) SetNextPageToken(v string) *GetTagsOutput

SetNextPageToken sets the NextPageToken field's value.

func (*GetTagsOutput) SetReturnSize

func (s *GetTagsOutput) SetReturnSize(v int64) *GetTagsOutput

SetReturnSize sets the ReturnSize field's value.

func (*GetTagsOutput) SetTags

func (s *GetTagsOutput) SetTags(v []string) *GetTagsOutput

SetTags sets the Tags field's value.

func (*GetTagsOutput) SetTotalSize

func (s *GetTagsOutput) SetTotalSize(v int64) *GetTagsOutput

SetTotalSize sets the TotalSize field's value.

func (GetTagsOutput) String

func (s GetTagsOutput) String() string

String returns the string representation

type GetTagsRequest

type GetTagsRequest struct {
	*aws.Request
	Input *GetTagsInput
}

GetTagsRequest is a API request type for the GetTags API operation.

func (GetTagsRequest) Send

func (r GetTagsRequest) Send() (*GetTagsOutput, error)

Send marshals and sends the GetTags API request.

type Granularity

type Granularity string
const (
	GranularityDaily   Granularity = "DAILY"
	GranularityMonthly Granularity = "MONTHLY"
)

Enum values for Granularity

type Group

type Group struct {

	// The keys included in this group.
	Keys []string `type:"list"`

	// The metrics included in this group.
	Metrics map[string]MetricValue `type:"map"`
	// contains filtered or unexported fields
}

One level of grouped data within the results. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/Group

func (Group) GoString

func (s Group) GoString() string

GoString returns the string representation

func (*Group) SetKeys

func (s *Group) SetKeys(v []string) *Group

SetKeys sets the Keys field's value.

func (*Group) SetMetrics

func (s *Group) SetMetrics(v map[string]MetricValue) *Group

SetMetrics sets the Metrics field's value.

func (Group) String

func (s Group) String() string

String returns the string representation

type GroupDefinition

type GroupDefinition struct {

	// The string that represents a key for a specified group.
	Key *string `type:"string"`

	// The string that represents the type of group.
	Type GroupDefinitionType `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

Represents a group when you specify a group by criteria, or in the response to a query with a specific grouping. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GroupDefinition

func (GroupDefinition) GoString

func (s GroupDefinition) GoString() string

GoString returns the string representation

func (*GroupDefinition) SetKey

func (s *GroupDefinition) SetKey(v string) *GroupDefinition

SetKey sets the Key field's value.

func (*GroupDefinition) SetType

SetType sets the Type field's value.

func (GroupDefinition) String

func (s GroupDefinition) String() string

String returns the string representation

type GroupDefinitionType

type GroupDefinitionType string
const (
	GroupDefinitionTypeDimension GroupDefinitionType = "DIMENSION"
	GroupDefinitionTypeTag       GroupDefinitionType = "TAG"
)

Enum values for GroupDefinitionType

type MetricValue

type MetricValue struct {

	// The actual number that represents the metric.
	Amount *string `type:"string"`

	// The unit that the metric is given in.
	Unit *string `type:"string"`
	// contains filtered or unexported fields
}

The aggregated value for a metric. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/MetricValue

func (MetricValue) GoString

func (s MetricValue) GoString() string

GoString returns the string representation

func (*MetricValue) SetAmount

func (s *MetricValue) SetAmount(v string) *MetricValue

SetAmount sets the Amount field's value.

func (*MetricValue) SetUnit

func (s *MetricValue) SetUnit(v string) *MetricValue

SetUnit sets the Unit field's value.

func (MetricValue) String

func (s MetricValue) String() string

String returns the string representation

type ReservationAggregates

type ReservationAggregates struct {

	// How many RI hours you purchased.
	PurchasedHours *string `type:"string"`

	// The total number of RI hours that you used.
	TotalActualHours *string `type:"string"`

	// The number of RI hours that you didn't use.
	UnusedHours *string `type:"string"`

	// The percentage of RI time that you used.
	UtilizationPercentage *string `type:"string"`
	// contains filtered or unexported fields
}

The aggregated numbers for your RI usage. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/ReservationAggregates

func (ReservationAggregates) GoString

func (s ReservationAggregates) GoString() string

GoString returns the string representation

func (*ReservationAggregates) SetPurchasedHours

func (s *ReservationAggregates) SetPurchasedHours(v string) *ReservationAggregates

SetPurchasedHours sets the PurchasedHours field's value.

func (*ReservationAggregates) SetTotalActualHours

func (s *ReservationAggregates) SetTotalActualHours(v string) *ReservationAggregates

SetTotalActualHours sets the TotalActualHours field's value.

func (*ReservationAggregates) SetUnusedHours

func (s *ReservationAggregates) SetUnusedHours(v string) *ReservationAggregates

SetUnusedHours sets the UnusedHours field's value.

func (*ReservationAggregates) SetUtilizationPercentage

func (s *ReservationAggregates) SetUtilizationPercentage(v string) *ReservationAggregates

SetUtilizationPercentage sets the UtilizationPercentage field's value.

func (ReservationAggregates) String

func (s ReservationAggregates) String() string

String returns the string representation

type ReservationUtilizationGroup

type ReservationUtilizationGroup struct {

	// The attributes for this group of RIs.
	Attributes map[string]string `type:"map"`

	// The key for a specific RI attribute.
	Key *string `type:"string"`

	// How much you used this group of RIs.
	Utilization *ReservationAggregates `type:"structure"`

	// The value of a specific RI attribute.
	Value *string `type:"string"`
	// contains filtered or unexported fields
}

A group of RIs that share a set of attributes. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/ReservationUtilizationGroup

func (ReservationUtilizationGroup) GoString

func (s ReservationUtilizationGroup) GoString() string

GoString returns the string representation

func (*ReservationUtilizationGroup) SetAttributes

SetAttributes sets the Attributes field's value.

func (*ReservationUtilizationGroup) SetKey

SetKey sets the Key field's value.

func (*ReservationUtilizationGroup) SetUtilization

SetUtilization sets the Utilization field's value.

func (*ReservationUtilizationGroup) SetValue

SetValue sets the Value field's value.

func (ReservationUtilizationGroup) String

String returns the string representation

type ResultByTime

type ResultByTime struct {

	// Whether or not this result is estimated.
	Estimated *bool `type:"boolean"`

	// The groups that are included in this time period.
	Groups []Group `type:"list"`

	// The time period covered by a result.
	TimePeriod *DateInterval `type:"structure"`

	// The total amount of cost or usage accrued during the time period.
	Total map[string]MetricValue `type:"map"`
	// contains filtered or unexported fields
}

The result that is associated with a time period. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/ResultByTime

func (ResultByTime) GoString

func (s ResultByTime) GoString() string

GoString returns the string representation

func (*ResultByTime) SetEstimated

func (s *ResultByTime) SetEstimated(v bool) *ResultByTime

SetEstimated sets the Estimated field's value.

func (*ResultByTime) SetGroups

func (s *ResultByTime) SetGroups(v []Group) *ResultByTime

SetGroups sets the Groups field's value.

func (*ResultByTime) SetTimePeriod

func (s *ResultByTime) SetTimePeriod(v *DateInterval) *ResultByTime

SetTimePeriod sets the TimePeriod field's value.

func (*ResultByTime) SetTotal

func (s *ResultByTime) SetTotal(v map[string]MetricValue) *ResultByTime

SetTotal sets the Total field's value.

func (ResultByTime) String

func (s ResultByTime) String() string

String returns the string representation

type TagValues

type TagValues struct {

	// The key for a tag.
	Key *string `type:"string"`

	// The specific value of a tag.
	Values []string `type:"list"`
	// contains filtered or unexported fields
}

The values that are available for a tag. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/TagValues

func (TagValues) GoString

func (s TagValues) GoString() string

GoString returns the string representation

func (*TagValues) SetKey

func (s *TagValues) SetKey(v string) *TagValues

SetKey sets the Key field's value.

func (*TagValues) SetValues

func (s *TagValues) SetValues(v []string) *TagValues

SetValues sets the Values field's value.

func (TagValues) String

func (s TagValues) String() string

String returns the string representation

type UtilizationByTime

type UtilizationByTime struct {

	// The groups that are included in this utilization result.
	Groups []ReservationUtilizationGroup `type:"list"`

	// The period of time over which this utilization was used.
	TimePeriod *DateInterval `type:"structure"`

	// The total number of RI hours that were used.
	Total *ReservationAggregates `type:"structure"`
	// contains filtered or unexported fields
}

The amount of utilization, in hours. Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/UtilizationByTime

func (UtilizationByTime) GoString

func (s UtilizationByTime) GoString() string

GoString returns the string representation

func (*UtilizationByTime) SetGroups

SetGroups sets the Groups field's value.

func (*UtilizationByTime) SetTimePeriod

func (s *UtilizationByTime) SetTimePeriod(v *DateInterval) *UtilizationByTime

SetTimePeriod sets the TimePeriod field's value.

func (*UtilizationByTime) SetTotal

SetTotal sets the Total field's value.

func (UtilizationByTime) String

func (s UtilizationByTime) String() string

String returns the string representation

Directories

Path Synopsis
Package costexploreriface provides an interface to enable mocking the AWS Cost Explorer Service service client for testing your code.
Package costexploreriface provides an interface to enable mocking the AWS Cost Explorer Service service client for testing your code.

Jump to

Keyboard shortcuts

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