搜索本产品文档关键词
虚机执行Http请求
所有文档
menu
没有找到结果,请重新输入

运维编排 OOS

虚机执行Http请求

用途

用于在多台云服务器BCC实例内执行Http请求

参数

名称 类型 描述
name String 模板任务名称,必填
operator String 模板任务类型,必填
properties Map<String, Object> 任务执行所需参数,必填,详细内容见下表

properties参数

名称 类型 描述
__workerSelectors__ List/Object 实例ID,必填,支持多选
method String 请求方法类型,必填
url String 请求地址,必填
headers Map<String, Object> 请求头,选填
body Object 请求体,选填
timeoutMill Integer 请求连接超时时间,选填,默认10000ms

示例

__workerSelectors__参数可以直接指定也可以引用模板中的全局参数,示例分别如下:

直接指定

{
    "name": "executeHttp",
    "operator": "BCE::Agent::ExecuteHttp",
    "properties": {
        "method": "GET",
        "url": "http://localhost:8080/api/getUser",
        "body": {
        },
        "headers": {
            "Content-Type": "application/json"
        },
        "timeoutMill": 5000,
        "__workerSelectors__": [
            {
                "instanceId":"i-pqJV5Ptu" // BCC短ID
            },
            {
                "instanceId":"i-rXV43yGW" // BCC短ID
            }
        ]
    }
}

引用全局参数

引用模板中的globalInstanceList全局参数

{
    "name": "executeHttp",
    "operator": "BCE::Agent::ExecuteHttp",
    "properties": {
        "method": "GET",
        "url": "http://localhost:8080/api/user/111",
        "body": {
        },
        "headers": {
            "Content-Type": "application/json"
        },
        "timeoutMill": 5000,
        "__workerSelectors__": {
            "Ref":"globalInstanceList"
        }
    }
}
上一篇
自动续费BCC实例
下一篇
CDS相关