/
api_op_PutResourceAttributes.go
176 lines (160 loc) · 6.37 KB
/
api_op_PutResourceAttributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Code generated by smithy-go-codegen DO NOT EDIT.
package migrationhub
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/migrationhub/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides identifying details of the resource being migrated so that it can be
// associated in the Application Discovery Service repository. This association
// occurs asynchronously after PutResourceAttributes returns.
// - Keep in mind that subsequent calls to PutResourceAttributes will override
// previously stored attributes. For example, if it is first called with a MAC
// address, but later, it is desired to add an IP address, it will then be required
// to call it with both the IP and MAC addresses to prevent overriding the MAC
// address.
// - Note the instructions regarding the special use case of the
// ResourceAttributeList (https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#migrationhub-PutResourceAttributes-request-ResourceAttributeList)
// parameter when specifying any "VM" related value.
//
// Because this is an asynchronous call, it will always return 200, whether an
// association occurs or not. To confirm if an association was found based on the
// provided details, call ListDiscoveredResources .
func (c *Client) PutResourceAttributes(ctx context.Context, params *PutResourceAttributesInput, optFns ...func(*Options)) (*PutResourceAttributesOutput, error) {
if params == nil {
params = &PutResourceAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutResourceAttributes", params, optFns, c.addOperationPutResourceAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutResourceAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutResourceAttributesInput struct {
// Unique identifier that references the migration task. Do not store personal
// data in this field.
//
// This member is required.
MigrationTaskName *string
// The name of the ProgressUpdateStream.
//
// This member is required.
ProgressUpdateStream *string
// Information about the resource that is being migrated. This data will be used
// to map the task to a resource in the Application Discovery Service repository.
// Takes the object array of ResourceAttribute where the Type field is reserved
// for the following values: IPV4_ADDRESS | IPV6_ADDRESS | MAC_ADDRESS | FQDN |
// VM_MANAGER_ID | VM_MANAGED_OBJECT_REFERENCE | VM_NAME | VM_PATH | BIOS_ID |
// MOTHERBOARD_SERIAL_NUMBER where the identifying value can be a string up to 256
// characters.
// - If any "VM" related value is set for a ResourceAttribute object, it is
// required that VM_MANAGER_ID , as a minimum, is always set. If VM_MANAGER_ID is
// not set, then all "VM" fields will be discarded and "VM" fields will not be used
// for matching the migration task to a server in Application Discovery Service
// repository. See the Example (https://docs.aws.amazon.com/migrationhub/latest/ug/API_PutResourceAttributes.html#API_PutResourceAttributes_Examples)
// section below for a use case of specifying "VM" related values.
// - If a server you are trying to match has multiple IP or MAC addresses, you
// should provide as many as you know in separate type/value pairs passed to the
// ResourceAttributeList parameter to maximize the chances of matching.
//
// This member is required.
ResourceAttributeList []types.ResourceAttribute
// Optional boolean flag to indicate whether any effect should take place. Used to
// test if the caller has permission to make the call.
DryRun bool
noSmithyDocumentSerde
}
type PutResourceAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutResourceAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourceAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourceAttributes{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "PutResourceAttributes"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addOpPutResourceAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourceAttributes(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutResourceAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "PutResourceAttributes",
}
}