CreateAddonRelease - 安装接入组件

安装接入组件,代表进行一次接入

接口说明

用于创建一个站点监控任务

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
cms:CreateAddonReleasecreate
*AddonRelease
acs:cms:{#regionId}:{#accountId}:integrationpolicy/{#PolicyId}/addonrelease/*

请求语法

POST /integration-policies/{policyId}/addon-releases HTTP/1.1

请求参数

名称类型必填描述示例值
bodyobject

请求体参数。

addonNamestring

需要接入监控的组件 Addon 名称。

cs-gpu
aliyunLangstring

组件的语言类型。

枚举值:
  • en英语
  • zh中文
zh
dryRunboolean

是否试运行,默认为 false。

枚举值:
  • true试运行
  • false不试运行
false
envTypestring

环境类型。如果 Policy 类型为 CS 和 ECS,对应使用,其他类型统一为 Cloud。

枚举值:
  • CS容器环境
  • ECSECS环境
  • Cloud云服务环境
CS
parentAddonReleaseIdstring

父级 AddonReleaseId。

policy-xxxxxxxxxxx
releaseNamestring

接入后的插件名称,如果不指定则生成默认规则名称。

test-gpu-integration-name
valuesstring

输入的元数据。

{"install":{"mode":"auto-install","listenPort":"9400"},"discoverMode":"instances","discover":{"instances":"worker-k8s-for-cs-c126d87c76218487e83ab322017f11b44"},"scrapeInterval":"15","enableSecuritecs-nodeyGroupInjection":"true","metricTags":""}
versionstring

需要接入监控的组件 Addon 版本。

0.0.2
workspacestring

安装组件资源的工作空间名称。

default
entityRulesEntityDiscoverRule

字段规则

policyIdstring

环境策略 ID。

policy-yyyyyyyyyy

返回参数

名称类型描述示例值
object

返回数据。

releaseobject

接入组件信息。

addonNamestring

接入监控的组件 Addon 名称。

cs-gpu
alertRuleCountlong

告警组数量。

6
conditionsarray<object>

组件安装阶段信息。

conditionsobject

操作符,支持精确匹配、前缀匹配、正则表达式三种方式。

firstTransitionTimestring

第一次转换时间。

2024-11-04T16:10:22+08:00
lastTransitionTimestring

最后一次转换时间。

2024-11-04T16:10:22+08:00
messagestring

详细信息。

The addon loaded successfully
statusstring

阶段状态。

{'phase': 'Created', 'executionDetails': [], 'invocations': [], 'latestExecError': {'message': '', 'code': '', 'requestId': '', 'extraInfo': '', 'title': ''}}
typestring

阶段类型。

Loaded
configstring

组件配置。

{"install":{"mode":"auto-install","listenPort":"9400"},"discoverMode":"instances","discover":{"instances":"worker-k8s-for-cs-c126d87c76218487e83ab322017f11b44"},"scrapeInterval":"15","enableSecuritecs-nodeyGroupInjection":"true","metricTags":""}
createTimestring

接入时间。

2024-11-05T15:21:30+08:00
dashboardCountlong

大盘数量。

3
environmentIdstring

环境 ID。

policy-xxxxxxxxxxx
exporterCountlong

插件数量。

2
haveConfigboolean

是否有配置。

true
installUserIdstring

安装的用户 ID。

1654218965xxxxxx
languagestring

语言。

zh
managedboolean

是否为托管组件。

true
parentAddonReleaseIdstring

父级 AddonReleaseId。

policy-xxxxxxxxxxx
policyIdstring

策略环境 ID。

policy-xxxxxxxxxx
regionIdstring

地域 ID。

cn-hangzhou
releaseIdstring

安装后的 ReleaseID。

2e898e60-5e6a-46d1-a994-xxxxxxxxxx
releaseNamestring

Release 的名称。

test-gpu-integration-name
scenestring

组件场景。

1
statusstring

组件状态。

200
updateTimestring

更新时间。

2024-09-13T02:21:02Z
userIdstring

所属用户 ID。

165421896xxxxxx
versionstring

组件版本。

1.0.0
envTypestring

环境类型。

CS
workspacestring

工作空间。

default
entityRulesEntityGroupBase

实体详情。

requestIdstring

请求 ID。

0CEC5375-C554-562B-A65F-9A629907C1F0

示例

正常返回示例

JSON格式

{
  "release": {
    "addonName": "cs-gpu",
    "alertRuleCount": 6,
    "conditions": [
      {
        "firstTransitionTime": "2024-11-04T16:10:22+08:00",
        "lastTransitionTime": "2024-11-04T16:10:22+08:00",
        "message": "The addon loaded successfully",
        "status": "{'phase': 'Created', 'executionDetails': [], 'invocations': [], 'latestExecError': {'message': '', 'code': '', 'requestId': '', 'extraInfo': '', 'title': ''}}",
        "type": "Loaded"
      }
    ],
    "config": {
      "install": {
        "mode": "auto-install",
        "listenPort": 9400
      },
      "discoverMode": "instances",
      "discover": {
        "instances": "worker-k8s-for-cs-c126d87c76218487e83ab322017f11b44"
      },
      "scrapeInterval": 15,
      "enableSecuritecs-nodeyGroupInjection": true,
      "metricTags": ""
    },
    "createTime": "2024-11-05T15:21:30+08:00",
    "dashboardCount": 3,
    "environmentId": "policy-xxxxxxxxxxx",
    "exporterCount": 2,
    "haveConfig": true,
    "installUserId": "1654218965xxxxxx",
    "language": "zh",
    "managed": true,
    "parentAddonReleaseId": "policy-xxxxxxxxxxx",
    "policyId": "policy-xxxxxxxxxx",
    "regionId": "cn-hangzhou",
    "releaseId": "2e898e60-5e6a-46d1-a994-xxxxxxxxxx",
    "releaseName": "test-gpu-integration-name",
    "scene": 1,
    "status": 200,
    "updateTime": "2024-09-13T02:21:02Z",
    "userId": "165421896xxxxxx",
    "version": "1.0.0",
    "envType": "CS",
    "workspace": "default",
    "entityRules": {
      "workspace": "default-cms-1654218***343050-cn-hangzhou",
      "regionId": "cn-heyuan",
      "entityQueries": [
        {
          "entityType": "acs.ecs.instance",
          "spl": ".entity with(type='acs.ecs.instance') | where region_id in ('cn-beijing')"
        }
      ],
      "description": "ECS 实例",
      "entityGroupId": "eg-1234567890",
      "entityRules": {
        "ipMatchRule": [
          {
            "ipFieldKey": "hostIp",
            "ipCIDR": "192.168.0.1/10"
          }
        ],
        "instanceIds": [
          "i-bp1gj8wyq4fxk28k6iy2"
        ],
        "fieldRules": [
          {
            "op": "in",
            "fieldKey": "instanceId",
            "fieldValues": [
              "i-bp1gj8wyq4fxk28k6iy2"
            ]
          }
        ],
        "annotations": [
          {
            "op": "in",
            "tagKey": "instanceId",
            "tagValues": [
              "i-bp1gj8wyq4fxk28k6iy2\n"
            ]
          }
        ],
        "resourceGroupId": "rg-acfm2m7atreujs1",
        "entityTypes": [
          "acs.ecs.instance"
        ],
        "regionIds": [
          "cn-shanghai"
        ],
        "tags": [
          {
            "op": "in",
            "tagKey": "project",
            "tagValues": [
              "demo"
            ]
          }
        ],
        "labels": [
          {
            "op": "in",
            "tagKey": "project",
            "tagValues": [
              "demo"
            ]
          }
        ]
      },
      "entityGroupName": "ECS 全部实体",
      "userId": "1654218***343050"
    }
  },
  "requestId": "0CEC5375-C554-562B-A65F-9A629907C1F0"
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史