1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package directconnect 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/directconnect/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 "time" 13) 14 15// Updates the AWS Direct Connect dedicated connection configuration. You can 16// update the following parameters for a connection: 17// 18// * The connection name 19// 20// * The 21// connection's MAC Security (MACsec) encryption mode. 22func (c *Client) UpdateConnection(ctx context.Context, params *UpdateConnectionInput, optFns ...func(*Options)) (*UpdateConnectionOutput, error) { 23 if params == nil { 24 params = &UpdateConnectionInput{} 25 } 26 27 result, metadata, err := c.invokeOperation(ctx, "UpdateConnection", params, optFns, addOperationUpdateConnectionMiddlewares) 28 if err != nil { 29 return nil, err 30 } 31 32 out := result.(*UpdateConnectionOutput) 33 out.ResultMetadata = metadata 34 return out, nil 35} 36 37type UpdateConnectionInput struct { 38 39 // The ID of the dedicated connection. You can use DescribeConnections to retrieve 40 // the connection ID. 41 // 42 // This member is required. 43 ConnectionId *string 44 45 // The name of the connection. 46 ConnectionName *string 47 48 // The connection MAC Security (MACsec) encryption mode. The valid values are 49 // no_encrypt, should_encrypt, and must_encrypt. 50 EncryptionMode *string 51} 52 53// Information about an AWS Direct Connect connection. 54type UpdateConnectionOutput struct { 55 56 // The Direct Connect endpoint on which the physical connection terminates. 57 // 58 // Deprecated: This member has been deprecated. 59 AwsDevice *string 60 61 // The Direct Connect endpoint on which the physical connection terminates. 62 AwsDeviceV2 *string 63 64 // The bandwidth of the connection. 65 Bandwidth *string 66 67 // The ID of the connection. 68 ConnectionId *string 69 70 // The name of the connection. 71 ConnectionName *string 72 73 // The state of the connection. The following are the possible values: 74 // 75 // * ordering: 76 // The initial state of a hosted connection provisioned on an interconnect. The 77 // connection stays in the ordering state until the owner of the hosted connection 78 // confirms or declines the connection order. 79 // 80 // * requested: The initial state of a 81 // standard connection. The connection stays in the requested state until the 82 // Letter of Authorization (LOA) is sent to the customer. 83 // 84 // * pending: The 85 // connection has been approved and is being initialized. 86 // 87 // * available: The network 88 // link is up and the connection is ready for use. 89 // 90 // * down: The network link is 91 // down. 92 // 93 // * deleting: The connection is being deleted. 94 // 95 // * deleted: The connection 96 // has been deleted. 97 // 98 // * rejected: A hosted connection in the ordering state enters 99 // the rejected state if it is deleted by the customer. 100 // 101 // * unknown: The state of 102 // the connection is not available. 103 ConnectionState types.ConnectionState 104 105 // The MAC Security (MACsec) connection encryption mode. The valid values are 106 // no_encrypt, should_encrypt, and must_encrypt. 107 EncryptionMode *string 108 109 // Indicates whether the connection supports a secondary BGP peer in the same 110 // address family (IPv4/IPv6). 111 HasLogicalRedundancy types.HasLogicalRedundancy 112 113 // Indicates whether jumbo frames (9001 MTU) are supported. 114 JumboFrameCapable *bool 115 116 // The ID of the LAG. 117 LagId *string 118 119 // The time of the most recent call to DescribeLoa for this connection. 120 LoaIssueTime *time.Time 121 122 // The location of the connection. 123 Location *string 124 125 // Indicates whether the connection supports MAC Security (MACsec). 126 MacSecCapable *bool 127 128 // The MAC Security (MACsec) security keys associated with the connection. 129 MacSecKeys []types.MacSecKey 130 131 // The ID of the AWS account that owns the connection. 132 OwnerAccount *string 133 134 // The name of the AWS Direct Connect service provider associated with the 135 // connection. 136 PartnerName *string 137 138 // The MAC Security (MACsec) port link status of the connection. The valid values 139 // are Encryption Up, which means that there is an active Connection Key Name, or 140 // Encryption Down. 141 PortEncryptionStatus *string 142 143 // The name of the service provider associated with the connection. 144 ProviderName *string 145 146 // The AWS Region where the connection is located. 147 Region *string 148 149 // The tags associated with the connection. 150 Tags []types.Tag 151 152 // The ID of the VLAN. 153 Vlan int32 154 155 // Metadata pertaining to the operation's result. 156 ResultMetadata middleware.Metadata 157} 158 159func addOperationUpdateConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { 160 err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateConnection{}, middleware.After) 161 if err != nil { 162 return err 163 } 164 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateConnection{}, middleware.After) 165 if err != nil { 166 return err 167 } 168 if err = addSetLoggerMiddleware(stack, options); err != nil { 169 return err 170 } 171 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 172 return err 173 } 174 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 175 return err 176 } 177 if err = addResolveEndpointMiddleware(stack, options); err != nil { 178 return err 179 } 180 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 181 return err 182 } 183 if err = addRetryMiddlewares(stack, options); err != nil { 184 return err 185 } 186 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 187 return err 188 } 189 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 190 return err 191 } 192 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 193 return err 194 } 195 if err = addClientUserAgent(stack); err != nil { 196 return err 197 } 198 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 199 return err 200 } 201 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 202 return err 203 } 204 if err = addOpUpdateConnectionValidationMiddleware(stack); err != nil { 205 return err 206 } 207 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConnection(options.Region), middleware.Before); err != nil { 208 return err 209 } 210 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 211 return err 212 } 213 if err = addResponseErrorMiddleware(stack); err != nil { 214 return err 215 } 216 if err = addRequestResponseLogging(stack, options); err != nil { 217 return err 218 } 219 return nil 220} 221 222func newServiceMetadataMiddleware_opUpdateConnection(region string) *awsmiddleware.RegisterServiceMetadata { 223 return &awsmiddleware.RegisterServiceMetadata{ 224 Region: region, 225 ServiceID: ServiceID, 226 SigningName: "directconnect", 227 OperationName: "UpdateConnection", 228 } 229} 230