computeoptimizer

package module
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 26 Imported by: 9

Documentation

Index

Constants

View Source
const ServiceAPIVersion = "2019-11-01"
View Source
const ServiceID = "Compute Optimizer"

Variables

This section is empty.

Functions

func AddResolveEndpointMiddleware

func AddResolveEndpointMiddleware(stack *middleware.Stack, options ResolveEndpointMiddlewareOptions)

func NewDefaultEndpointResolver

func NewDefaultEndpointResolver() *internalendpoints.Resolver

NewDefaultEndpointResolver constructs a new service endpoint resolver

func RemoveResolveEndpointMiddleware

func RemoveResolveEndpointMiddleware(stack *middleware.Stack) error

Types

type Client

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

AWS Compute Optimizer is a service that analyzes the configuration and utilization metrics of your AWS resources, such as EC2 instances and Auto Scaling groups. It reports whether your resources are optimal, and generates optimization recommendations to reduce the cost and improve the performance of your workloads. Compute Optimizer also provides recent utilization metric data, as well as projected utilization metric data for the recommendations, which you can use to evaluate which recommendation provides the best price-performance trade-off. The analysis of your usage patterns can help you decide when to move or resize your running resources, and still meet your performance and capacity requirements. For more information about Compute Optimizer, including the required permissions to use the service, see the AWS Compute Optimizer User Guide (https://docs.aws.amazon.com/compute-optimizer/latest/ug/).

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) DescribeRecommendationExportJobs

func (c *Client) DescribeRecommendationExportJobs(ctx context.Context, params *DescribeRecommendationExportJobsInput, optFns ...func(*Options)) (*DescribeRecommendationExportJobsOutput, error)

Describes recommendation export jobs created in the last seven days. <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations. Then use the <code>DescribeRecommendationExportJobs</code> action to view your export jobs.</p>

func (*Client) ExportAutoScalingGroupRecommendations

func (c *Client) ExportAutoScalingGroupRecommendations(ctx context.Context, params *ExportAutoScalingGroupRecommendationsInput, optFns ...func(*Options)) (*ExportAutoScalingGroupRecommendationsOutput, error)

Exports optimization recommendations for Auto Scaling groups. <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Auto Scaling group export job in progress per AWS Region.</p>

func (*Client) ExportEC2InstanceRecommendations

func (c *Client) ExportEC2InstanceRecommendations(ctx context.Context, params *ExportEC2InstanceRecommendationsInput, optFns ...func(*Options)) (*ExportEC2InstanceRecommendationsOutput, error)

Exports optimization recommendations for Amazon EC2 instances. <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Amazon EC2 instance export job in progress per AWS Region.</p>

func (*Client) GetAutoScalingGroupRecommendations

func (c *Client) GetAutoScalingGroupRecommendations(ctx context.Context, params *GetAutoScalingGroupRecommendationsInput, optFns ...func(*Options)) (*GetAutoScalingGroupRecommendationsOutput, error)

Returns Auto Scaling group recommendations. AWS Compute Optimizer currently generates recommendations for Auto Scaling groups that are configured to run instances of the M, C, R, T, and X instance families. The service does not generate recommendations for Auto Scaling groups that have a scaling policy attached to them, or that do not have the same values for desired, minimum, and maximum capacity. In order for Compute Optimizer to analyze your Auto Scaling groups, they must be of a fixed size. For more information, see the AWS Compute Optimizer User Guide (https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html).

func (*Client) GetEC2InstanceRecommendations

func (c *Client) GetEC2InstanceRecommendations(ctx context.Context, params *GetEC2InstanceRecommendationsInput, optFns ...func(*Options)) (*GetEC2InstanceRecommendationsOutput, error)

Returns Amazon EC2 instance recommendations. AWS Compute Optimizer currently generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) and Amazon EC2 Auto Scaling. It generates recommendations for M, C, R, T, and X instance families. For more information, see the AWS Compute Optimizer User Guide (https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html).

func (*Client) GetEC2RecommendationProjectedMetrics

func (c *Client) GetEC2RecommendationProjectedMetrics(ctx context.Context, params *GetEC2RecommendationProjectedMetricsInput, optFns ...func(*Options)) (*GetEC2RecommendationProjectedMetricsOutput, error)

Returns the projected utilization metrics of Amazon EC2 instance recommendations.

func (*Client) GetEnrollmentStatus

func (c *Client) GetEnrollmentStatus(ctx context.Context, params *GetEnrollmentStatusInput, optFns ...func(*Options)) (*GetEnrollmentStatusOutput, error)

Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service. If the account is the master account of an organization, this action also confirms the enrollment status of member accounts within the organization.

func (*Client) GetRecommendationSummaries

func (c *Client) GetRecommendationSummaries(ctx context.Context, params *GetRecommendationSummariesInput, optFns ...func(*Options)) (*GetRecommendationSummariesOutput, error)

Returns the optimization findings for an account. For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.

func (*Client) UpdateEnrollmentStatus

func (c *Client) UpdateEnrollmentStatus(ctx context.Context, params *UpdateEnrollmentStatusInput, optFns ...func(*Options)) (*UpdateEnrollmentStatusOutput, error)

Updates the enrollment (opt in) status of an account to the AWS Compute Optimizer service. If the account is a master account of an organization, this action can also be used to enroll member accounts within the organization.

type DescribeRecommendationExportJobsInput

type DescribeRecommendationExportJobsInput struct {

	// The token to advance to the next page of export jobs.
	NextToken *string

	// An array of objects that describe a filter to return a more specific list of
	// export jobs.
	Filters []*types.JobFilter

	// The identification numbers of the export jobs to return.  <p>An export job ID is
	// returned when you create an export using the
	// <code>ExportAutoScalingGroupRecommendations</code> or
	// <code>ExportEC2InstanceRecommendations</code> actions.</p> <p>All export jobs
	// created in the last seven days are returned if this parameter is omitted.</p>
	JobIds []*string

	// The maximum number of export jobs to return with a single request. To retrieve
	// the remaining results, make another request with the returned NextToken value.
	MaxResults *int32
}

type DescribeRecommendationExportJobsOutput

type DescribeRecommendationExportJobsOutput struct {

	// The token to use to advance to the next page of export jobs. This value is null
	// when there are no more pages of export jobs to return.
	NextToken *string

	// An array of objects that describe recommendation export jobs.
	RecommendationExportJobs []*types.RecommendationExportJob

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type EndpointResolver

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

EndpointResolver interface for resolving service endpoints.

func WithEndpointResolver

func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver

WithEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided fallbackResolver for resolution. awsResolver and fallbackResolver must not be nil

type EndpointResolverFunc

type EndpointResolverFunc func(region string, options ResolverOptions) (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 ResolverOptions) (endpoint aws.Endpoint, err error)

type ExportAutoScalingGroupRecommendationsInput

type ExportAutoScalingGroupRecommendationsInput struct {

	// Indicates whether to include recommendations for resources in all member
	// accounts of the organization if your account is the master account of an
	// organization. The member accounts must also be opted in to Compute Optimizer.
	// Recommendations for member accounts of the organization are not included in the
	// export file if this parameter is omitted. This parameter cannot be specified
	// together with the account IDs parameter. The parameters are mutually exclusive.
	// Recommendations for member accounts are not included in the export if this
	// parameter, or the account IDs parameter, is omitted.
	IncludeMemberAccounts *bool

	// An object to specify the destination Amazon Simple Storage Service (Amazon S3)
	// bucket name and key prefix for the export job. You must create the destination
	// Amazon S3 bucket for your recommendations export before you create the export
	// job. Compute Optimizer does not create the S3 bucket for you. After you create
	// the S3 bucket, ensure that it has the required permission policy to allow
	// Compute Optimizer to write the export file to it. If you plan to specify an
	// object prefix when you create the export job, you must include the object prefix
	// in the policy that you add to the S3 bucket. For more information, see Amazon S3
	// Bucket Policy for Compute Optimizer
	// (https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html)
	// in the Compute Optimizer user guide.
	//
	// This member is required.
	S3DestinationConfig *types.S3DestinationConfig

	// The format of the export file. The only export file format currently supported
	// is Csv.
	FileFormat types.FileFormat

	// The recommendations data to include in the export file.
	FieldsToExport []types.ExportableAutoScalingGroupField

	// The IDs of the AWS accounts for which to export Auto Scaling group
	// recommendations. If your account is the master account of an organization, use
	// this parameter to specify the member accounts for which you want to export
	// recommendations. This parameter cannot be specified together with the include
	// member accounts parameter. The parameters are mutually exclusive.
	// Recommendations for member accounts are not included in the export if this
	// parameter, or the include member accounts parameter, is omitted. You can specify
	// multiple account IDs per request.
	AccountIds []*string

	// An array of objects that describe a filter to export a more specific set of Auto
	// Scaling group recommendations.
	Filters []*types.Filter
}

type ExportAutoScalingGroupRecommendationsOutput

type ExportAutoScalingGroupRecommendationsOutput struct {

	// An object that describes the destination Amazon S3 bucket of a recommendations
	// export file.
	S3Destination *types.S3Destination

	// The identification number of the export job. Use the
	// DescribeRecommendationExportJobs action, and specify the job ID to view the
	// status of an export job.
	JobId *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type ExportEC2InstanceRecommendationsInput

type ExportEC2InstanceRecommendationsInput struct {

	// The IDs of the AWS accounts for which to export instance recommendations. If
	// your account is the master account of an organization, use this parameter to
	// specify the member accounts for which you want to export recommendations. This
	// parameter cannot be specified together with the include member accounts
	// parameter. The parameters are mutually exclusive. Recommendations for member
	// accounts are not included in the export if this parameter, or the include member
	// accounts parameter, is omitted. You can specify multiple account IDs per
	// request.
	AccountIds []*string

	// The format of the export file. The only export file format currently supported
	// is Csv.
	FileFormat types.FileFormat

	// The recommendations data to include in the export file.
	FieldsToExport []types.ExportableInstanceField

	// Indicates whether to include recommendations for resources in all member
	// accounts of the organization if your account is the master account of an
	// organization. The member accounts must also be opted in to Compute Optimizer.
	// Recommendations for member accounts of the organization are not included in the
	// export file if this parameter is omitted. Recommendations for member accounts
	// are not included in the export if this parameter, or the account IDs parameter,
	// is omitted.
	IncludeMemberAccounts *bool

	// An array of objects that describe a filter to export a more specific set of
	// instance recommendations.
	Filters []*types.Filter

	// An object to specify the destination Amazon Simple Storage Service (Amazon S3)
	// bucket name and key prefix for the export job. You must create the destination
	// Amazon S3 bucket for your recommendations export before you create the export
	// job. Compute Optimizer does not create the S3 bucket for you. After you create
	// the S3 bucket, ensure that it has the required permission policy to allow
	// Compute Optimizer to write the export file to it. If you plan to specify an
	// object prefix when you create the export job, you must include the object prefix
	// in the policy that you add to the S3 bucket. For more information, see Amazon S3
	// Bucket Policy for Compute Optimizer
	// (https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html)
	// in the Compute Optimizer user guide.
	//
	// This member is required.
	S3DestinationConfig *types.S3DestinationConfig
}

type ExportEC2InstanceRecommendationsOutput

type ExportEC2InstanceRecommendationsOutput struct {

	// The identification number of the export job. Use the
	// DescribeRecommendationExportJobs action, and specify the job ID to view the
	// status of an export job.
	JobId *string

	// An object that describes the destination Amazon S3 bucket of a recommendations
	// export file.
	S3Destination *types.S3Destination

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type GetAutoScalingGroupRecommendationsInput

type GetAutoScalingGroupRecommendationsInput struct {

	// The maximum number of Auto Scaling group recommendations to return with a single
	// request. To retrieve the remaining results, make another request with the
	// returned NextToken value.
	MaxResults *int32

	// An array of objects that describe a filter that returns a more specific list of
	// Auto Scaling group recommendations.
	Filters []*types.Filter

	// The token to advance to the next page of Auto Scaling group recommendations.
	NextToken *string

	// The Amazon Resource Name (ARN) of the Auto Scaling groups for which to return
	// recommendations.
	AutoScalingGroupArns []*string

	// The IDs of the AWS accounts for which to return Auto Scaling group
	// recommendations. If your account is the master account of an organization, use
	// this parameter to specify the member accounts for which you want to return Auto
	// Scaling group recommendations. Only one account ID can be specified per request.
	AccountIds []*string
}

type GetAutoScalingGroupRecommendationsOutput

type GetAutoScalingGroupRecommendationsOutput struct {

	// An array of objects that describe errors of the request. For example, an error
	// is returned if you request recommendations for an unsupported Auto Scaling
	// group.
	Errors []*types.GetRecommendationError

	// The token to use to advance to the next page of Auto Scaling group
	// recommendations. This value is null when there are no more pages of Auto Scaling
	// group recommendations to return.
	NextToken *string

	// An array of objects that describe Auto Scaling group recommendations.
	AutoScalingGroupRecommendations []*types.AutoScalingGroupRecommendation

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type GetEC2InstanceRecommendationsInput

type GetEC2InstanceRecommendationsInput struct {

	// The token to advance to the next page of instance recommendations.
	NextToken *string

	// The maximum number of instance recommendations to return with a single request.
	// To retrieve the remaining results, make another request with the returned
	// NextToken value.
	MaxResults *int32

	// The IDs of the AWS accounts for which to return instance recommendations. If
	// your account is the master account of an organization, use this parameter to
	// specify the member accounts for which you want to return instance
	// recommendations. Only one account ID can be specified per request.
	AccountIds []*string

	// The Amazon Resource Name (ARN) of the instances for which to return
	// recommendations.
	InstanceArns []*string

	// An array of objects that describe a filter that returns a more specific list of
	// instance recommendations.
	Filters []*types.Filter
}

type GetEC2InstanceRecommendationsOutput

type GetEC2InstanceRecommendationsOutput struct {

	// An array of objects that describe instance recommendations.
	InstanceRecommendations []*types.InstanceRecommendation

	// An array of objects that describe errors of the request. For example, an error
	// is returned if you request recommendations for an instance of an unsupported
	// instance family.
	Errors []*types.GetRecommendationError

	// The token to use to advance to the next page of instance recommendations. This
	// value is null when there are no more pages of instance recommendations to
	// return.
	NextToken *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type GetEC2RecommendationProjectedMetricsInput

type GetEC2RecommendationProjectedMetricsInput struct {

	// The time stamp of the last projected metrics data point to return.
	//
	// This member is required.
	EndTime *time.Time

	// The time stamp of the first projected metrics data point to return.
	//
	// This member is required.
	StartTime *time.Time

	// The granularity, in seconds, of the projected metrics data points.
	//
	// This member is required.
	Period *int32

	// The statistic of the projected metrics.
	//
	// This member is required.
	Stat types.MetricStatistic

	// The Amazon Resource Name (ARN) of the instances for which to return
	// recommendation projected metrics.
	//
	// This member is required.
	InstanceArn *string
}

type GetEC2RecommendationProjectedMetricsOutput

type GetEC2RecommendationProjectedMetricsOutput struct {

	// An array of objects that describe a projected metrics.
	RecommendedOptionProjectedMetrics []*types.RecommendedOptionProjectedMetric

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type GetEnrollmentStatusInput

type GetEnrollmentStatusInput struct {
}

type GetEnrollmentStatusOutput

type GetEnrollmentStatusOutput struct {

	// The reason for the enrollment status of the account. For example, an account
	// might show a status of Pending because member accounts of an organization
	// require more time to be enrolled in the service.
	StatusReason *string

	// Confirms the enrollment status of member accounts within the organization, if
	// the account is a master account of an organization.
	MemberAccountsEnrolled *bool

	// The enrollment status of the account.
	Status types.Status

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type GetRecommendationSummariesInput

type GetRecommendationSummariesInput struct {

	// The maximum number of recommendation summaries to return with a single request.
	// To retrieve the remaining results, make another request with the returned
	// NextToken value.
	MaxResults *int32

	// The token to advance to the next page of recommendation summaries.
	NextToken *string

	// The IDs of the AWS accounts for which to return recommendation summaries. If
	// your account is the master account of an organization, use this parameter to
	// specify the member accounts for which you want to return recommendation
	// summaries. Only one account ID can be specified per request.
	AccountIds []*string
}

type GetRecommendationSummariesOutput

type GetRecommendationSummariesOutput struct {

	// An array of objects that summarize a recommendation.
	RecommendationSummaries []*types.RecommendationSummary

	// The token to use to advance to the next page of recommendation summaries. This
	// value is null when there are no more pages of recommendation summaries to
	// return.
	NextToken *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

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

	// The credentials object to use when signing requests.
	Credentials aws.CredentialsProvider

	// The endpoint options to be used when attempting to resolve an endpoint.
	EndpointOptions ResolverOptions

	// The service endpoint resolver.
	EndpointResolver EndpointResolver

	// Signature Version 4 (SigV4) Signer
	HTTPSignerV4 HTTPSignerV4

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

func (Options) GetCredentials

func (o Options) GetCredentials() aws.CredentialsProvider

func (Options) GetEndpointOptions

func (o Options) GetEndpointOptions() ResolverOptions

func (Options) GetEndpointResolver

func (o Options) GetEndpointResolver() EndpointResolver

func (Options) GetHTTPSignerV4

func (o Options) GetHTTPSignerV4() HTTPSignerV4

func (Options) GetRegion

func (o Options) GetRegion() string

func (Options) GetRetryer

func (o Options) GetRetryer() retry.Retryer

type ResolveEndpoint

type ResolveEndpoint struct {
	Resolver EndpointResolver
	Options  ResolverOptions
}

func (*ResolveEndpoint) HandleSerialize

func (*ResolveEndpoint) ID

func (*ResolveEndpoint) ID() string

type ResolveEndpointMiddlewareOptions

type ResolveEndpointMiddlewareOptions interface {
	GetEndpointResolver() EndpointResolver
	GetEndpointOptions() ResolverOptions
}

type ResolverOptions

type ResolverOptions = internalendpoints.Options

ResolverOptions is the service endpoint resolver options

type UpdateEnrollmentStatusInput

type UpdateEnrollmentStatusInput struct {

	// The new enrollment status of the account. Accepted options are Active or
	// Inactive. You will get an error if Pending or Failed are specified.
	//
	// This member is required.
	Status types.Status

	// Indicates whether to enroll member accounts of the organization if the your
	// account is the master account of an organization.
	IncludeMemberAccounts *bool
}

type UpdateEnrollmentStatusOutput

type UpdateEnrollmentStatusOutput struct {

	// The reason for the enrollment status of the account. For example, an account
	// might show a status of Pending because member accounts of an organization
	// require more time to be enrolled in the service.
	StatusReason *string

	// The enrollment status of the account.
	Status types.Status

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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