|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { ECSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECSClient"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { StopServiceDeploymentRequest, StopServiceDeploymentResponse } from "../models/models_0"; |
| 10 | +import { de_StopServiceDeploymentCommand, se_StopServiceDeploymentCommand } from "../protocols/Aws_json1_1"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link StopServiceDeploymentCommand}. |
| 21 | + */ |
| 22 | +export interface StopServiceDeploymentCommandInput extends StopServiceDeploymentRequest {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link StopServiceDeploymentCommand}. |
| 27 | + */ |
| 28 | +export interface StopServiceDeploymentCommandOutput extends StopServiceDeploymentResponse, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p>Stops an ongoing service deployment.</p> |
| 32 | + * <p>The following stop types are avaiable:</p> |
| 33 | + * <ul> |
| 34 | + * <li> |
| 35 | + * <p>ROLLBACK - This option rolls back the service deployment to the previous |
| 36 | + * service revision. </p> |
| 37 | + * <p>You can use this option even if you didn't configure the service deployment |
| 38 | + * for the rollback option. </p> |
| 39 | + * </li> |
| 40 | + * </ul> |
| 41 | + * <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stop-service-deployment.html">Stopping Amazon ECS |
| 42 | + * service deployments</a> in the <i>Amazon Elastic Container Service Developer |
| 43 | + * Guide</i>.</p> |
| 44 | + * @example |
| 45 | + * Use a bare-bones client and the command you need to make an API call. |
| 46 | + * ```javascript |
| 47 | + * import { ECSClient, StopServiceDeploymentCommand } from "@aws-sdk/client-ecs"; // ES Modules import |
| 48 | + * // const { ECSClient, StopServiceDeploymentCommand } = require("@aws-sdk/client-ecs"); // CommonJS import |
| 49 | + * const client = new ECSClient(config); |
| 50 | + * const input = { // StopServiceDeploymentRequest |
| 51 | + * serviceDeploymentArn: "STRING_VALUE", // required |
| 52 | + * stopType: "ABORT" || "ROLLBACK", |
| 53 | + * }; |
| 54 | + * const command = new StopServiceDeploymentCommand(input); |
| 55 | + * const response = await client.send(command); |
| 56 | + * // { // StopServiceDeploymentResponse |
| 57 | + * // serviceDeploymentArn: "STRING_VALUE", |
| 58 | + * // }; |
| 59 | + * |
| 60 | + * ``` |
| 61 | + * |
| 62 | + * @param StopServiceDeploymentCommandInput - {@link StopServiceDeploymentCommandInput} |
| 63 | + * @returns {@link StopServiceDeploymentCommandOutput} |
| 64 | + * @see {@link StopServiceDeploymentCommandInput} for command's `input` shape. |
| 65 | + * @see {@link StopServiceDeploymentCommandOutput} for command's `response` shape. |
| 66 | + * @see {@link ECSClientResolvedConfig | config} for ECSClient's `config` shape. |
| 67 | + * |
| 68 | + * @throws {@link AccessDeniedException} (client fault) |
| 69 | + * <p>You don't have authorization to perform the requested action.</p> |
| 70 | + * |
| 71 | + * @throws {@link ClientException} (client fault) |
| 72 | + * <p>These errors are usually caused by a client action. This client action might be using |
| 73 | + * an action or resource on behalf of a user that doesn't have permissions to use the |
| 74 | + * action or resource. Or, it might be specifying an identifier that isn't valid.</p> |
| 75 | + * <p>The following list includes additional causes for the error:</p> |
| 76 | + * <ul> |
| 77 | + * <li> |
| 78 | + * <p>The <code>RunTask</code> could not be processed because you use managed |
| 79 | + * scaling and there is a capacity error because the quota of tasks in the |
| 80 | + * <code>PROVISIONING</code> per cluster has been reached. For information |
| 81 | + * about the service quotas, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html">Amazon ECS |
| 82 | + * service quotas</a>.</p> |
| 83 | + * </li> |
| 84 | + * </ul> |
| 85 | + * |
| 86 | + * @throws {@link ConflictException} (client fault) |
| 87 | + * <p>The <code>RunTask</code> request could not be processed due to conflicts. The provided |
| 88 | + * <code>clientToken</code> is already in use with a different <code>RunTask</code> |
| 89 | + * request. The <code>resourceIds</code> are the existing task ARNs which are already |
| 90 | + * associated with the <code>clientToken</code>. </p> |
| 91 | + * <p>To fix this issue:</p> |
| 92 | + * <ul> |
| 93 | + * <li> |
| 94 | + * <p>Run <code>RunTask</code> with a unique <code>clientToken</code>.</p> |
| 95 | + * </li> |
| 96 | + * <li> |
| 97 | + * <p>Run <code>RunTask</code> with the <code>clientToken</code> and the original |
| 98 | + * set of parameters</p> |
| 99 | + * </li> |
| 100 | + * </ul> |
| 101 | + * |
| 102 | + * @throws {@link InvalidParameterException} (client fault) |
| 103 | + * <p>The specified parameter isn't valid. Review the available parameters for the API |
| 104 | + * request.</p> |
| 105 | + * <p>For more information about service event errors, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages-list.html">Amazon ECS service event messages</a>. </p> |
| 106 | + * |
| 107 | + * @throws {@link ServerException} (server fault) |
| 108 | + * <p>These errors are usually caused by a server issue.</p> |
| 109 | + * |
| 110 | + * @throws {@link ServiceDeploymentNotFoundException} (client fault) |
| 111 | + * <p>The service deploy ARN that you specified in the <code>StopServiceDeployment</code> doesn't exist. You can use <code>ListServiceDeployments</code> to retrieve the service deployment ARNs.</p> |
| 112 | + * |
| 113 | + * @throws {@link UnsupportedFeatureException} (client fault) |
| 114 | + * <p>The specified task isn't supported in this Region.</p> |
| 115 | + * |
| 116 | + * @throws {@link ECSServiceException} |
| 117 | + * <p>Base exception class for all service exceptions from ECS service.</p> |
| 118 | + * |
| 119 | + * |
| 120 | + * @example To stop a service deployment |
| 121 | + * ```javascript |
| 122 | + * // This example stops the service deployment using the ROLLBACK option. |
| 123 | + * const input = { |
| 124 | + * serviceDeploymentArn: "arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1r", |
| 125 | + * stopType: "ROLLBACK" |
| 126 | + * }; |
| 127 | + * const command = new StopServiceDeploymentCommand(input); |
| 128 | + * const response = await client.send(command); |
| 129 | + * /* response is |
| 130 | + * { |
| 131 | + * serviceDeploymentArn: "arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1r" |
| 132 | + * } |
| 133 | + * *\/ |
| 134 | + * ``` |
| 135 | + * |
| 136 | + * @public |
| 137 | + */ |
| 138 | +export class StopServiceDeploymentCommand extends $Command |
| 139 | + .classBuilder< |
| 140 | + StopServiceDeploymentCommandInput, |
| 141 | + StopServiceDeploymentCommandOutput, |
| 142 | + ECSClientResolvedConfig, |
| 143 | + ServiceInputTypes, |
| 144 | + ServiceOutputTypes |
| 145 | + >() |
| 146 | + .ep(commonParams) |
| 147 | + .m(function (this: any, Command: any, cs: any, config: ECSClientResolvedConfig, o: any) { |
| 148 | + return [ |
| 149 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 150 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 151 | + ]; |
| 152 | + }) |
| 153 | + .s("AmazonEC2ContainerServiceV20141113", "StopServiceDeployment", {}) |
| 154 | + .n("ECSClient", "StopServiceDeploymentCommand") |
| 155 | + .f(void 0, void 0) |
| 156 | + .ser(se_StopServiceDeploymentCommand) |
| 157 | + .de(de_StopServiceDeploymentCommand) |
| 158 | + .build() { |
| 159 | + /** @internal type navigation helper, not in runtime. */ |
| 160 | + protected declare static __types: { |
| 161 | + api: { |
| 162 | + input: StopServiceDeploymentRequest; |
| 163 | + output: StopServiceDeploymentResponse; |
| 164 | + }; |
| 165 | + sdk: { |
| 166 | + input: StopServiceDeploymentCommandInput; |
| 167 | + output: StopServiceDeploymentCommandOutput; |
| 168 | + }; |
| 169 | + }; |
| 170 | +} |
0 commit comments