根据基线ID获取基线配置。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String GetBaseline

系统规定参数。取值:GetBaseline

BaselineId Long 123456

基线的ID,可以通过 ListBaselines 获取。

ProjectId Long 10000

基线所监控的项目空间ID,可从 ListBaselines 获取。

返回数据

名称 类型 示例值 描述
Success Boolean true

请求是否成功,true

  • 成功,false
  • 失败。
ErrorCode String 1031203110005

错误码。

ErrorMessage String The specified parameters are invalid

错误信息。

HttpStatusCode Integer 200

HTTP返回码。

Data Object

返回值。

BaselineId Long 1001

基线的id。

BaselineName String 测试基线

基线名。

ProjectId Long 10000

项目id。

Owner String 9527952****

责任人。

Priority Integer 1

基线的优先级,取值集合为{1,3,5,7,8}。

BaselineType String DAILY

基线类型。

  • DAILY
    • 日基线
  • HOURLY
    • 小时基线
OverTimeSettings Array of OverTimeSetting

基线承诺时间设置。

Cycle Integer 1

承诺时间对应的周期,天基线是1,小时基线可以配置最多24个周期。

Time String 00:00

承诺时间,hh:mm格式,hh的取值范围为0,47,mm的取值范围为0,59

Enabled Boolean true

是否开启基线。

NodeIds Array of Long 700003559814

节点ID。

AlertEnabled Boolean true

是否开启告警。

  • true
  • false
AlertMarginThreshold Integer 60

预警余量,单位为分钟。

AlertSettings Array of AlertSetting

告警设置。

AlertType String BASELINE

告警类型

  • BASELINE
    • 基线
  • TOPIC
    • 事件
AlertMethods Array of String MAIL
  • MAIL
    • 邮件
  • SMS
    • 短信
  • PHONE
    • 语音
  • DINGROBOTS
    • 钉钉机器人
  • WEBHOOKS
    • webhook
SilenceStartTime String 00:00:00

静默开始时间,格式为 HH:mm:ss 。

SilenceEndTime String 00:00:00

静默结束时间,格式为 HH:mm:ss 。

AlertInterval Integer 900

事件告警间隔,单位为秒。

AlertMaximum Integer 1

事件告警最大次数。

DingRobots Array of DingRobot

钉钉机器人列表。

WebUrl String https://oapi.dingtalk.com/robot/send?access_token=xxx

钉钉机器人地址。

AtAll Boolean true

是否 @所有人。

Webhooks Array of String https://open.feishu.cn/open-apis/bot/v2/hook/xxx

企业微信或飞书机器人的webhook地址,多个webhook地址之间使用英文逗号(,)分隔。alertMethods 中需要包含 WEBHOOKS 告警方式。仅DataWorks企业版支持。

可用地域:华东2(上海)、西南1(成都)、华北3(张家口)、华北2(北京)、华东1(杭州)、华南1(深圳)、中国(香港)、欧洲中部 1(法兰克福)、亚太东南1(新加坡)。

TopicTypes Array of String SLOW

事件告警类型。

  • SLOW
    • 变慢
  • ERROR
    • 出错
BaselineAlertEnabled Boolean false

基线告警开关,基线特有配置。

  • true
    • 开启
  • false
    • 关闭
AlertRecipientType String OWNER

告警接收人类型。

  • OWNER
    • 任务责任人
  • OTHER
    • 指定的人
  • SHIFT_SCHEDULE
    • 值班表
AlertRecipient String 123123

告警接收人详情。

  • AlertRecipientType 为 OWNER:uid列表,多个uid使用英文 , 分割
  • AlertRecipientType 为 SHIFT_SCHEDULE:值班表uid
  • AlertRecipientType 为 OTHER: 空
RequestId String ecb967ec-c137-48a5-860****

请求ID。

示例

请求示例

http(s)://[Endpoint]/?Action=GetBaseline
&BaselineId=123456
&ProjectId=123456
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetBaselineResponse>
    <Success>true</Success>
    <ErrorCode>1031203110005</ErrorCode>
    <ErrorMessage>The specified parameters are invalid</ErrorMessage>
    <HttpStatusCode>200</HttpStatusCode>
    <Data>
        <BaselineId>1001</BaselineId>
        <BaselineName>测试基线</BaselineName>
        <ProjectId>10000</ProjectId>
        <Owner>9527952****</Owner>
        <Priority>1</Priority>
        <BaselineType>DAILY</BaselineType>
        <OverTimeSettings>
            <Cycle>1</Cycle>
            <Time>00:00</Time>
        </OverTimeSettings>
        <Enabled>true</Enabled>
        <TaskIds>123123</TaskIds>
        <AlertEnabled>true</AlertEnabled>
        <AlertMarginThreshold>60</AlertMarginThreshold>
        <AlertSettings>
            <AlertType>BASELINE</AlertType>
            <AlertMethods>MAIL</AlertMethods>
            <SilenceStartTime>00:00:00</SilenceStartTime>
            <SilenceEndTime>00:00:00</SilenceEndTime>
            <AlertInterval>900</AlertInterval>
            <AlertMaximum>1</AlertMaximum>
            <DingRobots>
                <WebUrl>https://oapi.dingtalk.com/robot/send?access_token=xxx</WebUrl>
                <AtAll>true</AtAll>
            </DingRobots>
            <Webhooks>https://open.feishu.cn/open-apis/bot/v2/hook/xxx</Webhooks>
            <TopicTypes>SLOW</TopicTypes>
            <BaselineAlertEnabled>false</BaselineAlertEnabled>
            <AlertRecipientType>OWNER</AlertRecipientType>
            <AlertRecipient>123123</AlertRecipient>
        </AlertSettings>
    </Data>
    <RequestId>ecb967ec-c137-48a5-860****</RequestId>
</GetBaselineResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Success" : true,
  "ErrorCode" : "1031203110005",
  "ErrorMessage" : "The specified parameters are invalid",
  "HttpStatusCode" : 200,
  "Data" : {
    "BaselineId" : 1001,
    "BaselineName" : "测试基线",
    "ProjectId" : 10000,
    "Owner" : "9527952****",
    "Priority" : 1,
    "BaselineType" : "DAILY",
    "OverTimeSettings" : [ {
      "Cycle" : 1,
      "Time" : "00:00"
    } ],
    "Enabled" : true,
    "TaskIds" : [ 123123 ],
    "AlertEnabled" : true,
    "AlertMarginThreshold" : 60,
    "AlertSettings" : [ {
      "AlertType" : "BASELINE",
      "AlertMethods" : [ "MAIL" ],
      "SilenceStartTime" : "00:00:00",
      "SilenceEndTime" : "00:00:00",
      "AlertInterval" : 900,
      "AlertMaximum" : 1,
      "DingRobots" : [ {
        "WebUrl" : "https://oapi.dingtalk.com/robot/send?access_token=xxx",
        "AtAll" : true
      } ],
      "Webhooks" : [ "https://open.feishu.cn/open-apis/bot/v2/hook/xxx" ],
      "TopicTypes" : [ "SLOW" ],
      "BaselineAlertEnabled" : false,
      "AlertRecipientType" : "OWNER",
      "AlertRecipient" : "123123"
    } ]
  },
  "RequestId" : "ecb967ec-c137-48a5-860****"
}

错误码

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