本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
命令数据包 (aws_opsworks_command)
重要
该 AWS OpsWorks Stacks 服务于 2024 年 5 月 26 日终止,新客户和现有客户均已禁用。我们强烈建议客户尽快将其工作负载迁移到其他解决方案。如果您对迁移有疑问,请通过 re AWS : Post 或通过 Pre
表示 OpsWorks Stacks 在一个或多个实例上运行的命令的设置。
以下示例演示了如何使用 Chef 搜索来先后搜索单个数据包项目和多个数据包项目,以将包含命令类型和发送时间的消息写入 Chef 日志:
command = search("aws_opsworks_command").first Chef::Log.info("********** The command's type is '#{command['type']}' **********") Chef::Log.info("********** The command was sent at '#{command['sent_at']}' **********") search("aws_opsworks_command").each do |command| Chef::Log.info("********** The command's type is '#{command['type']}' **********") Chef::Log.info("********** The command was sent at '#{command['sent_at']}' **********") end
- args
-
命令的参数 (字符串)。
- command_id
-
命令的随机唯一标识符,由 OpsWorks Stacks(字符串)分配。
- iam_user_arn
-
如果命令是由客户创建的,即为创建命令的用户的 Amazon 资源名称 (ARN) (字符串)。
- instance_id
-
运行命令的实例的标识符 (字符串)。
- sent_at
-
OpsWorks Stacks 运行命令的时间戳(字符串)。
- type
-
命令的类型 (字符串)。有效值包括:
-
"configure" -
"deploy" -
"deregister" -
"execute_recipes" -
"grant_remote_access" -
"install_dependencies" -
"restart" -
"revoke_remote_access" -
"rollback" -
"setup" -
"shutdown" -
"start" -
"stop" -
"sync_remote_users" -
"undeploy" -
"update_agent" -
"update_custom_cookbooks" -
"update_dependencies"
-