1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package ecs
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/ecs/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Describes one or more of your clusters.
15func (c *Client) DescribeClusters(ctx context.Context, params *DescribeClustersInput, optFns ...func(*Options)) (*DescribeClustersOutput, error) {
16	if params == nil {
17		params = &DescribeClustersInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "DescribeClusters", params, optFns, addOperationDescribeClustersMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*DescribeClustersOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type DescribeClustersInput struct {
31
32	// A list of up to 100 cluster names or full cluster Amazon Resource Name (ARN)
33	// entries. If you do not specify a cluster, the default cluster is assumed.
34	Clusters []string
35
36	// Whether to include additional information about your clusters in the response.
37	// If this field is omitted, the attachments, statistics, and tags are not
38	// included. If ATTACHMENTS is specified, the attachments for the container
39	// instances or tasks within the cluster are included. If SETTINGS is specified,
40	// the settings for the cluster are included. If STATISTICS is specified, the
41	// following additional information, separated by launch type, is included:
42	//
43	// *
44	// runningEC2TasksCount
45	//
46	// * runningFargateTasksCount
47	//
48	// * pendingEC2TasksCount
49	//
50	// *
51	// pendingFargateTasksCount
52	//
53	// * activeEC2ServiceCount
54	//
55	// *
56	// activeFargateServiceCount
57	//
58	// * drainingEC2ServiceCount
59	//
60	// *
61	// drainingFargateServiceCount
62	//
63	// If TAGS is specified, the metadata tags associated
64	// with the cluster are included.
65	Include []types.ClusterField
66}
67
68type DescribeClustersOutput struct {
69
70	// The list of clusters.
71	Clusters []types.Cluster
72
73	// Any failures associated with the call.
74	Failures []types.Failure
75
76	// Metadata pertaining to the operation's result.
77	ResultMetadata middleware.Metadata
78}
79
80func addOperationDescribeClustersMiddlewares(stack *middleware.Stack, options Options) (err error) {
81	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeClusters{}, middleware.After)
82	if err != nil {
83		return err
84	}
85	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeClusters{}, middleware.After)
86	if err != nil {
87		return err
88	}
89	if err = addSetLoggerMiddleware(stack, options); err != nil {
90		return err
91	}
92	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
93		return err
94	}
95	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
96		return err
97	}
98	if err = addResolveEndpointMiddleware(stack, options); err != nil {
99		return err
100	}
101	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
102		return err
103	}
104	if err = addRetryMiddlewares(stack, options); err != nil {
105		return err
106	}
107	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
108		return err
109	}
110	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
111		return err
112	}
113	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
114		return err
115	}
116	if err = addClientUserAgent(stack); err != nil {
117		return err
118	}
119	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
120		return err
121	}
122	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
123		return err
124	}
125	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClusters(options.Region), middleware.Before); err != nil {
126		return err
127	}
128	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addResponseErrorMiddleware(stack); err != nil {
132		return err
133	}
134	if err = addRequestResponseLogging(stack, options); err != nil {
135		return err
136	}
137	return nil
138}
139
140func newServiceMetadataMiddleware_opDescribeClusters(region string) *awsmiddleware.RegisterServiceMetadata {
141	return &awsmiddleware.RegisterServiceMetadata{
142		Region:        region,
143		ServiceID:     ServiceID,
144		SigningName:   "ecs",
145		OperationName: "DescribeClusters",
146	}
147}
148