|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; |
| 3 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; |
| 4 | +import { Command as $Command } from "@aws-sdk/smithy-client"; |
| 5 | +import { |
| 6 | + FinalizeHandlerArguments, |
| 7 | + Handler, |
| 8 | + HandlerExecutionContext, |
| 9 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 10 | + MetadataBearer as __MetadataBearer, |
| 11 | + MiddlewareStack, |
| 12 | + SerdeContext as __SerdeContext, |
| 13 | +} from "@aws-sdk/types"; |
| 14 | + |
| 15 | +import { LightsailClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LightsailClient"; |
| 16 | +import { |
| 17 | + UpdateInstanceMetadataOptionsRequest, |
| 18 | + UpdateInstanceMetadataOptionsRequestFilterSensitiveLog, |
| 19 | + UpdateInstanceMetadataOptionsResult, |
| 20 | + UpdateInstanceMetadataOptionsResultFilterSensitiveLog, |
| 21 | +} from "../models/models_1"; |
| 22 | +import { |
| 23 | + deserializeAws_json1_1UpdateInstanceMetadataOptionsCommand, |
| 24 | + serializeAws_json1_1UpdateInstanceMetadataOptionsCommand, |
| 25 | +} from "../protocols/Aws_json1_1"; |
| 26 | + |
| 27 | +export interface UpdateInstanceMetadataOptionsCommandInput extends UpdateInstanceMetadataOptionsRequest {} |
| 28 | +export interface UpdateInstanceMetadataOptionsCommandOutput |
| 29 | + extends UpdateInstanceMetadataOptionsResult, |
| 30 | + __MetadataBearer {} |
| 31 | + |
| 32 | +/** |
| 33 | + * <p>Modifies the Amazon Lightsail instance metadata parameters on a running or stopped |
| 34 | + * instance. When you modify the parameters on a running instance, the <code>GetInstance</code> |
| 35 | + * or <code>GetInstances</code> API operation initially responds with a state of |
| 36 | + * <code>pending</code>. After the parameter modifications are successfully applied, the state |
| 37 | + * changes to <code>applied</code> in subsequent <code>GetInstance</code> or |
| 38 | + * <code>GetInstances</code> API calls. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-instance-metadata-service">Use IMDSv2 with an Amazon Lightsail instance</a> in the <i>Amazon Lightsail Developer Guide</i>.</p> |
| 39 | + * @example |
| 40 | + * Use a bare-bones client and the command you need to make an API call. |
| 41 | + * ```javascript |
| 42 | + * import { LightsailClient, UpdateInstanceMetadataOptionsCommand } from "@aws-sdk/client-lightsail"; // ES Modules import |
| 43 | + * // const { LightsailClient, UpdateInstanceMetadataOptionsCommand } = require("@aws-sdk/client-lightsail"); // CommonJS import |
| 44 | + * const client = new LightsailClient(config); |
| 45 | + * const command = new UpdateInstanceMetadataOptionsCommand(input); |
| 46 | + * const response = await client.send(command); |
| 47 | + * ``` |
| 48 | + * |
| 49 | + * @see {@link UpdateInstanceMetadataOptionsCommandInput} for command's `input` shape. |
| 50 | + * @see {@link UpdateInstanceMetadataOptionsCommandOutput} for command's `response` shape. |
| 51 | + * @see {@link LightsailClientResolvedConfig | config} for LightsailClient's `config` shape. |
| 52 | + * |
| 53 | + */ |
| 54 | +export class UpdateInstanceMetadataOptionsCommand extends $Command< |
| 55 | + UpdateInstanceMetadataOptionsCommandInput, |
| 56 | + UpdateInstanceMetadataOptionsCommandOutput, |
| 57 | + LightsailClientResolvedConfig |
| 58 | +> { |
| 59 | + // Start section: command_properties |
| 60 | + // End section: command_properties |
| 61 | + |
| 62 | + constructor(readonly input: UpdateInstanceMetadataOptionsCommandInput) { |
| 63 | + // Start section: command_constructor |
| 64 | + super(); |
| 65 | + // End section: command_constructor |
| 66 | + } |
| 67 | + |
| 68 | + /** |
| 69 | + * @internal |
| 70 | + */ |
| 71 | + resolveMiddleware( |
| 72 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 73 | + configuration: LightsailClientResolvedConfig, |
| 74 | + options?: __HttpHandlerOptions |
| 75 | + ): Handler<UpdateInstanceMetadataOptionsCommandInput, UpdateInstanceMetadataOptionsCommandOutput> { |
| 76 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 77 | + |
| 78 | + const stack = clientStack.concat(this.middlewareStack); |
| 79 | + |
| 80 | + const { logger } = configuration; |
| 81 | + const clientName = "LightsailClient"; |
| 82 | + const commandName = "UpdateInstanceMetadataOptionsCommand"; |
| 83 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 84 | + logger, |
| 85 | + clientName, |
| 86 | + commandName, |
| 87 | + inputFilterSensitiveLog: UpdateInstanceMetadataOptionsRequestFilterSensitiveLog, |
| 88 | + outputFilterSensitiveLog: UpdateInstanceMetadataOptionsResultFilterSensitiveLog, |
| 89 | + }; |
| 90 | + const { requestHandler } = configuration; |
| 91 | + return stack.resolve( |
| 92 | + (request: FinalizeHandlerArguments<any>) => |
| 93 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 94 | + handlerExecutionContext |
| 95 | + ); |
| 96 | + } |
| 97 | + |
| 98 | + private serialize(input: UpdateInstanceMetadataOptionsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 99 | + return serializeAws_json1_1UpdateInstanceMetadataOptionsCommand(input, context); |
| 100 | + } |
| 101 | + |
| 102 | + private deserialize( |
| 103 | + output: __HttpResponse, |
| 104 | + context: __SerdeContext |
| 105 | + ): Promise<UpdateInstanceMetadataOptionsCommandOutput> { |
| 106 | + return deserializeAws_json1_1UpdateInstanceMetadataOptionsCommand(output, context); |
| 107 | + } |
| 108 | + |
| 109 | + // Start section: command_body_extra |
| 110 | + // End section: command_body_extra |
| 111 | +} |
0 commit comments