api_op_UpdateContainerService.go raw

   1  // Code generated by smithy-go-codegen DO NOT EDIT.
   2  
   3  package lightsail
   4  
   5  import (
   6  	"context"
   7  	"fmt"
   8  	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
   9  	"github.com/aws/aws-sdk-go-v2/service/lightsail/types"
  10  	"github.com/aws/smithy-go/middleware"
  11  	smithyhttp "github.com/aws/smithy-go/transport/http"
  12  )
  13  
  14  // Updates the configuration of your Amazon Lightsail container service, such as
  15  // its power, scale, and public domain names.
  16  func (c *Client) UpdateContainerService(ctx context.Context, params *UpdateContainerServiceInput, optFns ...func(*Options)) (*UpdateContainerServiceOutput, error) {
  17  	if params == nil {
  18  		params = &UpdateContainerServiceInput{}
  19  	}
  20  
  21  	result, metadata, err := c.invokeOperation(ctx, "UpdateContainerService", params, optFns, c.addOperationUpdateContainerServiceMiddlewares)
  22  	if err != nil {
  23  		return nil, err
  24  	}
  25  
  26  	out := result.(*UpdateContainerServiceOutput)
  27  	out.ResultMetadata = metadata
  28  	return out, nil
  29  }
  30  
  31  type UpdateContainerServiceInput struct {
  32  
  33  	// The name of the container service to update.
  34  	//
  35  	// This member is required.
  36  	ServiceName *string
  37  
  38  	// A Boolean value to indicate whether the container service is disabled.
  39  	IsDisabled *bool
  40  
  41  	// The power for the container service.
  42  	//
  43  	// The power specifies the amount of memory, vCPUs, and base monthly cost of each
  44  	// node of the container service. The power and scale of a container service makes
  45  	// up its configured capacity. To determine the monthly price of your container
  46  	// service, multiply the base price of the power with the scale (the number of
  47  	// nodes) of the service.
  48  	//
  49  	// Use the GetContainerServicePowers action to view the specifications of each
  50  	// power option.
  51  	Power types.ContainerServicePowerName
  52  
  53  	// An object to describe the configuration for the container service to access
  54  	// private container image repositories, such as Amazon Elastic Container Registry
  55  	// (Amazon ECR) private repositories.
  56  	//
  57  	// For more information, see [Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service] in the Amazon Lightsail Developer Guide.
  58  	//
  59  	// [Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service]: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-container-service-ecr-private-repo-access
  60  	PrivateRegistryAccess *types.PrivateRegistryAccessRequest
  61  
  62  	// The public domain names to use with the container service, such as example.com
  63  	// and www.example.com .
  64  	//
  65  	// You can specify up to four public domain names for a container service. The
  66  	// domain names that you specify are used when you create a deployment with a
  67  	// container configured as the public endpoint of your container service.
  68  	//
  69  	// If you don't specify public domain names, then you can use the default domain
  70  	// of the container service.
  71  	//
  72  	// You must create and validate an SSL/TLS certificate before you can use public
  73  	// domain names with your container service. Use the CreateCertificate action to
  74  	// create a certificate for the public domain names you want to use with your
  75  	// container service.
  76  	//
  77  	// You can specify public domain names using a string to array map as shown in the
  78  	// example later on this page.
  79  	PublicDomainNames map[string][]string
  80  
  81  	// The scale for the container service.
  82  	//
  83  	// The scale specifies the allocated compute nodes of the container service. The
  84  	// power and scale of a container service makes up its configured capacity. To
  85  	// determine the monthly price of your container service, multiply the base price
  86  	// of the power with the scale (the number of nodes) of the service.
  87  	Scale *int32
  88  
  89  	noSmithyDocumentSerde
  90  }
  91  
  92  type UpdateContainerServiceOutput struct {
  93  
  94  	// An object that describes a container service.
  95  	ContainerService *types.ContainerService
  96  
  97  	// Metadata pertaining to the operation's result.
  98  	ResultMetadata middleware.Metadata
  99  
 100  	noSmithyDocumentSerde
 101  }
 102  
 103  func (c *Client) addOperationUpdateContainerServiceMiddlewares(stack *middleware.Stack, options Options) (err error) {
 104  	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
 105  		return err
 106  	}
 107  	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateContainerService{}, middleware.After)
 108  	if err != nil {
 109  		return err
 110  	}
 111  	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateContainerService{}, middleware.After)
 112  	if err != nil {
 113  		return err
 114  	}
 115  	if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateContainerService"); err != nil {
 116  		return fmt.Errorf("add protocol finalizers: %v", err)
 117  	}
 118  
 119  	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
 120  		return err
 121  	}
 122  	if err = addSetLoggerMiddleware(stack, options); err != nil {
 123  		return err
 124  	}
 125  	if err = addClientRequestID(stack); err != nil {
 126  		return err
 127  	}
 128  	if err = addComputeContentLength(stack); err != nil {
 129  		return err
 130  	}
 131  	if err = addResolveEndpointMiddleware(stack, options); err != nil {
 132  		return err
 133  	}
 134  	if err = addComputePayloadSHA256(stack); err != nil {
 135  		return err
 136  	}
 137  	if err = addRetry(stack, options); err != nil {
 138  		return err
 139  	}
 140  	if err = addRawResponseToMetadata(stack); err != nil {
 141  		return err
 142  	}
 143  	if err = addRecordResponseTiming(stack); err != nil {
 144  		return err
 145  	}
 146  	if err = addSpanRetryLoop(stack, options); err != nil {
 147  		return err
 148  	}
 149  	if err = addClientUserAgent(stack, options); err != nil {
 150  		return err
 151  	}
 152  	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
 153  		return err
 154  	}
 155  	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
 156  		return err
 157  	}
 158  	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
 159  		return err
 160  	}
 161  	if err = addTimeOffsetBuild(stack, c); err != nil {
 162  		return err
 163  	}
 164  	if err = addUserAgentRetryMode(stack, options); err != nil {
 165  		return err
 166  	}
 167  	if err = addCredentialSource(stack, options); err != nil {
 168  		return err
 169  	}
 170  	if err = addOpUpdateContainerServiceValidationMiddleware(stack); err != nil {
 171  		return err
 172  	}
 173  	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateContainerService(options.Region), middleware.Before); err != nil {
 174  		return err
 175  	}
 176  	if err = addRecursionDetection(stack); err != nil {
 177  		return err
 178  	}
 179  	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
 180  		return err
 181  	}
 182  	if err = addResponseErrorMiddleware(stack); err != nil {
 183  		return err
 184  	}
 185  	if err = addRequestResponseLogging(stack, options); err != nil {
 186  		return err
 187  	}
 188  	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
 189  		return err
 190  	}
 191  	if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
 192  		return err
 193  	}
 194  	if err = addInterceptAttempt(stack, options); err != nil {
 195  		return err
 196  	}
 197  	if err = addInterceptors(stack, options); err != nil {
 198  		return err
 199  	}
 200  	return nil
 201  }
 202  
 203  func newServiceMetadataMiddleware_opUpdateContainerService(region string) *awsmiddleware.RegisterServiceMetadata {
 204  	return &awsmiddleware.RegisterServiceMetadata{
 205  		Region:        region,
 206  		ServiceID:     ServiceID,
 207  		OperationName: "UpdateContainerService",
 208  	}
 209  }
 210