CreateAddonRelease - 安装接入组件

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

接口说明

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

调试

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

调试

授权信息

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

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

cms:CreateAddonRelease

create

*AddonRelease

acs:cms:{#regionId}:{#accountId}:integrationpolicy/{#PolicyId}/addonrelease/*

请求语法

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

路径参数

名称

类型

必填

描述

示例值

policyId

string

环境策略 ID。

policy-yyyyyyyyyy

请求参数

名称

类型

必填

描述

示例值

body

object

请求体参数。

addonName

string

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

cs-gpu

aliyunLang

string

组件的语言类型。

枚举值:

  • en :

    英语

  • zh :

    中文

zh

dryRun

boolean

是否试运行,默认为 false。

枚举值:

  • true :

    试运行

  • false :

    不试运行

false

envType

string

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

枚举值:

  • CS :

    容器环境

  • ECS :

    ECS 环境

  • Cloud :

    云服务环境

CS

parentAddonReleaseId

string

父级 AddonReleaseId。

policy-xxxxxxxxxxx

releaseName

string

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

test-gpu-integration-name

values

string

输入的元数据。

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

version

string

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

0.0.2

workspace

string

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

default

entityRules EntityDiscoverRule

字段规则

返回参数

名称

类型

描述

示例值

object

返回数据。

release

object

接入组件信息。

addonName

string

接入监控的组件 Addon 名称。

cs-gpu

alertRuleCount

integer

告警组数量。

6

conditions

array<object>

组件安装阶段信息。

object

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

firstTransitionTime

string

第一次转换时间。

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

lastTransitionTime

string

最后一次转换时间。

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

message

string

详细信息。

The addon loaded successfully

status

string

阶段状态。

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

type

string

阶段类型。

Loaded

config

string

组件配置。

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

createTime

string

接入时间。

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

dashboardCount

integer

大盘数量。

3

environmentId

string

环境 ID。

policy-xxxxxxxxxxx

exporterCount

integer

插件数量。

2

haveConfig

boolean

是否有配置。

true

installUserId

string

安装的用户 ID。

1654218965xxxxxx

language

string

语言。

zh

managed

boolean

是否为托管组件。

true

parentAddonReleaseId

string

父级 AddonReleaseId。

policy-xxxxxxxxxxx

policyId

string

策略环境 ID。

policy-xxxxxxxxxx

regionId

string

地域 ID。

cn-hangzhou

releaseId

string

安装后的 ReleaseID。

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

releaseName

string

Release 的名称。

test-gpu-integration-name

scene

string

组件场景。

1

status

string

组件状态。

200

updateTime

string

更新时间。

2024-09-13T02:21:02Z

userId

string

所属用户 ID。

165421896xxxxxx

version

string

组件版本。

1.0.0

envType

string

环境类型。

CS

workspace

string

工作空间。

default

entityRules EntityGroupBase

实体详情。

requestId

string

请求 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"
}

错误码

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

变更历史

更多信息,参考变更详情