文档

CreateEnvPodMonitor - 创建环境的PodMonitor

更新时间:

创建环境的PodMonitor。

调试

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

授权信息

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

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

请求参数

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

地域 ID。

cn-hangzhou
AliyunLangstring

语言环境, 默认为中文 zh | en

zh
EnvironmentIdstring

环境实例 ID

env-xxxxxx
DryRunboolean

试运行:检查格式是否合法、是否能匹配到 targets。

true
ConfigYamlstring

PodMonitor 的 yaml 配置串。

参见补充说明。

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

Id of the request

78901766-3806-4E96-8E47-CFEF59E4****
Codeinteger

返回码。返回 200 代表成功。

200
Dataobject

返回结果。

MatchedMsgstring

target 匹配提示信息

匹配成功。
Namespacestring

命名空间。

arms-prom
PodMonitorNamestring

创建成功的 podMonitor 名称

arms-admin-pm1
MatchedTargetCountstring

匹配出的 targets 数量

1
Messagestring

返回结果的提示信息。

message

示例

正常返回示例

JSON格式

{
  "RequestId": "78901766-3806-4E96-8E47-CFEF59E4****",
  "Code": 200,
  "Data": {
    "MatchedMsg": "匹配成功。",
    "Namespace": "arms-prom",
    "PodMonitorName": "arms-admin-pm1",
    "MatchedTargetCount": "1"
  },
  "Message": "message"
}

错误码

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

变更历史

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

ConfigYaml 示例:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: arms-admin-pm1
  namespace: arms-prom
  annotations:
    arms.prometheus.io/discovery: 'true'
spec:
  selector:
    matchLabels:
      app: arms-prometheus-ack-arms-prometheus
      release: arms-prometheus
  namespaceSelector:
    any: true    
  podMetricsEndpoints:
  - interval: 30s
    targetPort: 9335
    path: /metrics
  - interval: 10s
    targetPort: 9335
    path: /metrics1

其中 arms.prometheus.io/discovery 必须存在,其值为“true”,表示 serviceMonitor 启用,否则表示停止。

  • 本页导读 (1)
文档反馈