1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package gamelift 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/gamelift/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Retrieves the resource capacity settings for a fleet location. The data returned 15// includes the current capacity (number of EC2 instances) and some scaling 16// settings for the requested fleet location. Use this operation to retrieve 17// capacity information for a fleet's remote location or home Region (you can also 18// retrieve home Region capacity by calling DescribeFleetCapacity). To retrieve 19// capacity data, identify a fleet and location. If successful, a FleetCapacity 20// object is returned for the requested fleet location. Learn more Setting up 21// GameLift fleets 22// (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)GameLift 23// metrics for fleets 24// (https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet) 25// Related actions CreateFleetLocations | DescribeFleetLocationAttributes | 26// DescribeFleetLocationCapacity | DescribeFleetLocationUtilization | 27// DescribeFleetAttributes | DescribeFleetCapacity | DescribeFleetUtilization | 28// UpdateFleetCapacity | StopFleetActions | DeleteFleetLocations | All APIs by task 29// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets) 30func (c *Client) DescribeFleetLocationCapacity(ctx context.Context, params *DescribeFleetLocationCapacityInput, optFns ...func(*Options)) (*DescribeFleetLocationCapacityOutput, error) { 31 if params == nil { 32 params = &DescribeFleetLocationCapacityInput{} 33 } 34 35 result, metadata, err := c.invokeOperation(ctx, "DescribeFleetLocationCapacity", params, optFns, addOperationDescribeFleetLocationCapacityMiddlewares) 36 if err != nil { 37 return nil, err 38 } 39 40 out := result.(*DescribeFleetLocationCapacityOutput) 41 out.ResultMetadata = metadata 42 return out, nil 43} 44 45// Represents the input for a request operation. 46type DescribeFleetLocationCapacityInput struct { 47 48 // A unique identifier for the fleet to request location capacity for. You can use 49 // either the fleet ID or ARN value. 50 // 51 // This member is required. 52 FleetId *string 53 54 // The fleet location to retrieve capacity information for. Specify a location in 55 // the form of an AWS Region code, such as us-west-2. 56 // 57 // This member is required. 58 Location *string 59} 60 61// Represents the returned data in response to a request operation. 62type DescribeFleetLocationCapacityOutput struct { 63 64 // Resource capacity information for the requested fleet location. Capacity objects 65 // are returned only for fleets and locations that currently exist. 66 FleetCapacity *types.FleetCapacity 67 68 // Metadata pertaining to the operation's result. 69 ResultMetadata middleware.Metadata 70} 71 72func addOperationDescribeFleetLocationCapacityMiddlewares(stack *middleware.Stack, options Options) (err error) { 73 err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFleetLocationCapacity{}, middleware.After) 74 if err != nil { 75 return err 76 } 77 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFleetLocationCapacity{}, middleware.After) 78 if err != nil { 79 return err 80 } 81 if err = addSetLoggerMiddleware(stack, options); err != nil { 82 return err 83 } 84 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 85 return err 86 } 87 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 88 return err 89 } 90 if err = addResolveEndpointMiddleware(stack, options); err != nil { 91 return err 92 } 93 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 94 return err 95 } 96 if err = addRetryMiddlewares(stack, options); err != nil { 97 return err 98 } 99 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 100 return err 101 } 102 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 103 return err 104 } 105 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 106 return err 107 } 108 if err = addClientUserAgent(stack); err != nil { 109 return err 110 } 111 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 112 return err 113 } 114 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 115 return err 116 } 117 if err = addOpDescribeFleetLocationCapacityValidationMiddleware(stack); err != nil { 118 return err 119 } 120 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFleetLocationCapacity(options.Region), middleware.Before); err != nil { 121 return err 122 } 123 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 124 return err 125 } 126 if err = addResponseErrorMiddleware(stack); err != nil { 127 return err 128 } 129 if err = addRequestResponseLogging(stack, options); err != nil { 130 return err 131 } 132 return nil 133} 134 135func newServiceMetadataMiddleware_opDescribeFleetLocationCapacity(region string) *awsmiddleware.RegisterServiceMetadata { 136 return &awsmiddleware.RegisterServiceMetadata{ 137 Region: region, 138 ServiceID: ServiceID, 139 SigningName: "gamelift", 140 OperationName: "DescribeFleetLocationCapacity", 141 } 142} 143