src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

api_op_UpdateTrafficPolicyInstance.go (4830B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 
      8 	"github.com/aws/aws-sdk-go-v2/service/route53/types"
      9 	"github.com/aws/smithy-go/middleware"
     10 )
     11 
     12 // After you submit a UpdateTrafficPolicyInstance request, there's a brief delay
     13 // while Route 53 creates the resource record sets that are specified in the
     14 // traffic policy definition. Use GetTrafficPolicyInstance with the id of updated
     15 // traffic policy instance confirm that the UpdateTrafficPolicyInstance request
     16 // completed successfully. For more information, see the State response element.
     17 //
     18 // Updates the resource record sets in a specified hosted zone that were created
     19 // based on the settings in a specified traffic policy version.
     20 //
     21 // When you update a traffic policy instance, Amazon Route 53 continues to respond
     22 // to DNS queries for the root resource record set name (such as example.com) while
     23 // it replaces one group of resource record sets with another. Route 53 performs
     24 // the following operations:
     25 //
     26 //   - Route 53 creates a new group of resource record sets based on the specified
     27 //     traffic policy. This is true regardless of how significant the differences are
     28 //     between the existing resource record sets and the new resource record sets.
     29 //
     30 //   - When all of the new resource record sets have been created, Route 53 starts
     31 //     to respond to DNS queries for the root resource record set name (such as
     32 //     example.com) by using the new resource record sets.
     33 //
     34 //   - Route 53 deletes the old group of resource record sets that are associated
     35 //     with the root resource record set name.
     36 func (c *Client) UpdateTrafficPolicyInstance(ctx context.Context, params *UpdateTrafficPolicyInstanceInput, optFns ...func(*Options)) (*UpdateTrafficPolicyInstanceOutput, error) {
     37 	if params == nil {
     38 		params = &UpdateTrafficPolicyInstanceInput{}
     39 	}
     40 
     41 	result, metadata, err := c.invokeOperation(ctx, "UpdateTrafficPolicyInstance", params, optFns, c.addOperationUpdateTrafficPolicyInstanceMiddlewares)
     42 	if err != nil {
     43 		return nil, err
     44 	}
     45 
     46 	out := result.(*UpdateTrafficPolicyInstanceOutput)
     47 	out.ResultMetadata = metadata
     48 	return out, nil
     49 }
     50 
     51 // A complex type that contains information about the resource record sets that
     52 // you want to update based on a specified traffic policy instance.
     53 type UpdateTrafficPolicyInstanceInput struct {
     54 
     55 	// The ID of the traffic policy instance that you want to update.
     56 	//
     57 	// This member is required.
     58 	Id *string
     59 
     60 	// The TTL that you want Amazon Route 53 to assign to all of the updated resource
     61 	// record sets.
     62 	//
     63 	// This member is required.
     64 	TTL *int64
     65 
     66 	// The ID of the traffic policy that you want Amazon Route 53 to use to update
     67 	// resource record sets for the specified traffic policy instance.
     68 	//
     69 	// This member is required.
     70 	TrafficPolicyId *string
     71 
     72 	// The version of the traffic policy that you want Amazon Route 53 to use to
     73 	// update resource record sets for the specified traffic policy instance.
     74 	//
     75 	// This member is required.
     76 	TrafficPolicyVersion *int32
     77 
     78 	noSmithyDocumentSerde
     79 }
     80 
     81 // A complex type that contains information about the resource record sets that
     82 // Amazon Route 53 created based on a specified traffic policy.
     83 type UpdateTrafficPolicyInstanceOutput struct {
     84 
     85 	// A complex type that contains settings for the updated traffic policy instance.
     86 	//
     87 	// This member is required.
     88 	TrafficPolicyInstance *types.TrafficPolicyInstance
     89 
     90 	// Metadata pertaining to the operation's result.
     91 	ResultMetadata middleware.Metadata
     92 
     93 	noSmithyDocumentSerde
     94 }
     95 
     96 func (c *Client) addOperationUpdateTrafficPolicyInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
     97 	err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateTrafficPolicyInstance{}, middleware.After)
     98 	if err != nil {
     99 		return err
    100 	}
    101 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateTrafficPolicyInstance{}, middleware.After)
    102 	if err != nil {
    103 		return err
    104 	}
    105 
    106 	if err = addComputeContentLength(stack); err != nil {
    107 		return err
    108 	}
    109 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    110 		return err
    111 	}
    112 	if err = addComputePayloadSHA256(stack); err != nil {
    113 		return err
    114 	}
    115 	if err = addRecordResponseTiming(stack, options); err != nil {
    116 		return err
    117 	}
    118 	if err = addCredentialSource(stack, options); err != nil {
    119 		return err
    120 	}
    121 	if err = addOpUpdateTrafficPolicyInstanceValidationMiddleware(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = addResponseErrorMiddleware(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = addRequestResponseLogging(stack, options); err != nil {
    131 		return err
    132 	}
    133 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    134 		return err
    135 	}
    136 	if err = addInterceptors(stack, options); err != nil {
    137 		return err
    138 	}
    139 	return nil
    140 }