将 StopDeployment 与 CLI 配合使用 - AWS SDK 代码示例

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

StopDeployment 与 CLI 配合使用

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

CLI
AWS CLI

尝试停止部署

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

aws deploy stop-deployment --deployment-id d-A1B2C3111

输出:

{ "status": "Succeeded", "statusMessage": "No more commands will be scheduled for execution in the deployment instances" }
  • 有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 StopDeployment

PowerShell
Tools for PowerShell V4

示例 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 Reference (V4)》中的 StopDeployment

Tools for PowerShell V5

示例 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 Reference (V5)》中的 StopDeployment