与 AWS SDK或StopDeployment一起使用 CLI - AWS SDK 代码示例

AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

与 AWS SDK或StopDeployment一起使用 CLI

以下代码示例演示如何使用 StopDeployment

CLI
AWS CLI

尝试停止部署

以下stop-deployment示例尝试停止与用户 AWS 账户关联的正在进行的部署。

aws 部署停止部署——deployment-id d-a1b2c3111

输出:

{ "status": "Succeeded", "statusMessage": "No more commands will be scheduled for execution in the deployment instances" }
PowerShell
用于 PowerShell

示例 1:此示例尝试使用指定的部署 ID 停止部署。

Stop-CDDeployment -DeploymentId d-LJQNREYEX

输出:

Status StatusMessage ------ ------------- Pending Stopping Pending. Stopping to schedule commands in the deployment instances
  • 有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考StopDeployment中的。