百度智能云

All Product Document

          Cloud Monitor

          Alarm Strategy-related APIs

          Alarm Strategy-related APIs


          Alarm Strategy List Query API


          API description

          This API retrieves the list of Alarm Strategies for Cloud Product Monitor, Site Monitor, and related alarms.

          Request parameters

          Name Types Description Required or not Parameter location
          userId String User ID Yes RequestBody
          scope String Cloud Product Scope, limited to the following character set: 0~9, A~Z, a~z, _ Yes RequestBody
          region String Region, default: bj No RequestBody
          dimensions String A dimension consists of dimensionName:dimensionValue. When a metric includes multiple dimensions, connect them using semicolons, e.g., dimensionName:dimensionValue;dimensionName:dimensionValue. Only one value can be specified per dimension. No RequestBody
          order String Sorting method Yes RequestBody
          pageSize int Number per page Yes RequestBody
          pageNo int Page number Yes RequestBody
          actionEnabled boolean Whether it is enabled No RequestBody

          Parameter explanation

          • For concepts like Scope, Metric, Statistic, and Dimension, refer to Core Concepts.

          Return field description

          Types Description
          PageResultResponse<AlarmConfig> Alarm Strategy List

          Request example

          // build client
          ak := "ALTA*********CYG"
          sk := "b2c5*********3ac1"
          endpoint := "bcm.bj.baidubce.com"
          bcmClient, _ := bcm.NewClient(ak, sk, endpoint)
          req := &model.ListSingleInstanceAlarmConfigsRequest{
          		Scope:    "BCE_BCC",
          		UserId:   bcmConf.UserId,
          		PageNo:   1,
          		PageSize: 10,
          	}
          	resp, err := bcmClient.ListSingleInstanceAlarmConfigs(req)
          	if err != nil {
          		t.Errorf("bcm get single instance alarm policys error with %v\n", err)
          	}
          content, _ := json.Marshal(resp)
          fmt.Println(string(content))

          Appendix

          AlarmConfig

          Name Types Description
          alarmDescription String Automatically generated, alarm rule description
          alarmName String Unique alarm name under userId
          aliasName String For frontend display use, duplicates are allowed
          userId String User ID
          scope String Associated Cloud Product Scope
          region String Region
          monitorObject MonitorObject Monitor Object
          type AlarmType(enum) Alarm type, options:
          NORMAL (Metric alarm)
          EVENT (Event alarm)
          eventTypeList List< String > Event type list
          level AlarmLevel(enum) Alarm levels, options:
          NOTICE (Notice)
          WARNING (Warning)
          MAJOR (Major)
          CRITICAL (Critical)
          actionEnabled Boolean Alarm notification status
          rules List< List<AlarmRule> > Alarm rule list
          alarmActions Set< String > Actions to be taken in the alarm status
          okActions Set< String > Actions to be taken in the normal status
          insufficientActions Set< String > Actions under insufficient data collection status
          insufficientCycle int No-data alarm judgment period
          srcName String Instance group ID
          srcType String Instance group type
          repeatAlarmCycle int Repeated alarm period
          maxRepeatCount int Maximum alarm repetition count
          callbackUrl String Alarm callback address
          callbackToken String Alarm callback token
          Previous
          Alarm History-related APIs
          Next
          Batch Data Query Interface