• 地址:广州市天河区华南植物园-龙洞慧创百思G220
  • 免费热线 : 020-87581205
  • 电子邮箱 : sw@51mimu.com

ALIYUN::ECS::Command_ECS_资源类型_资源编排-阿里云

 知识中心     |      2020-06-23 18:43:53

ALIYUN::ECS::Command

更新时间:2020-02-25 10:06:55

编辑 我的收藏

新浪微博 微信 钉钉

本页目录

ALIYUN::ECS::Command 类型用于新建云助手命令。

语法

{
  "Type": "ALIYUN::ECS::Command",
  "Properties": {
    "Name": String,
    "WorkingDir": String,
    "CommandContent": String,
    "Timeout": Integer,
    "Type": String,
    "Description": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
Name String 命令名称,支持全字符集。长度不得超过 30 个字符。
WorkingDir String 您创建的命令在 ECS 实例中运行的目录。
CommandContent String

命令 Base64 编码后的内容。

当您传入请求参数 Type 后,必须同时传入该参数。

该参数的值必须使用 Base64 编码后传输,且脚本内容的大小在 Base64 编码之后不能超过 16 KB。

Timeout Integer

您创建的命令在 ECS 实例中执行时最大的超时时间,单位为秒。

当因为某种原因无法运行您创建的命令时,会出现超时现象;超时后,会强制终止命令进程,即取消命令的 PID。

默认值:3600

Type String

命令的类型。

取值范围:
  • RunBatScript:创建一个在 Windows 实例中运行的 Bat 脚本
  • RunPowerShellScript:创建一个在 Windows 实例中运行的 PowerShell 脚本
  • RunShellScript:创建一个在 Linux 实例中运行的 Shell 脚本
Description String 命令描述,支持全字符集。长度不得超过100个字符。

返回值

Fn::GetAtt

  • CommandId:命令 ID。

示例

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "WorkingDir": {
      "Type": "String",
      "Description": "The path where command will be executed in the instance."
    },
    "CommandContent": {
      "Type": "String",
      "Description": "The content of command. Content requires base64 encoding. Maximum size support 16KB."
    },
    "Type": {
      "Type": "String",
      "Description": "The type of command."
    },
    "Description": {
      "Type": "String",
      "Description": "The description of command."
    },
    "Timeout": {
      "Type": "Number",
      "Description": "Total timeout when the command is executed in the instance. Input the time unit as second. Default is 3600s."
    },
    "Name": {
      "Type": "String",
      "Description": "The name of command."
    }
  },
  "Resources": {
    "Command": {
      "Type": "ALIYUN::ECS::Command",
      "Properties": {
        "WorkingDir": {
          "Ref": "WorkingDir"
        },
        "CommandContent": {
          "Ref": "CommandContent"
        },
        "Type": {
          "Ref": "Type"
        },
        "Description": {
          "Ref": "Description"
        },
        "Timeout": {
          "Ref": "Timeout"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "CommandId": {
      "Description": "The id of command created.",
      "Value": {
        "Fn::GetAtt": [
          "Command",
          "CommandId"
        ]
      }
    }
  }
}


COPYRIGHT © 2018-2019,WWW.51MIMU.COM,ALL RIGHTS RESERVED版权所有 © 广州米姆信息科技有限公司(阿里云、腾讯云代理商) 粤ICP备18145377号

sitemap feed