云审计服务 CTS-创建关键操作通知:请求示例

时间:2023-12-22 17:31:29

请求示例

  • 创建完整类型关键操作通知请求样例。

    POST https://{endpoint}/v3/{project_id}/notifications
    
    {
      "notification_name" : "test",
      "filter" : {
        "is_support_filter" : true,
        "rule" : [ "code != 200", "api_version = v1.0", "trace_rating = normal", "trace_type != ApiCall", "resource_id = xxx", "resource_name = xxx" ],
        "condition" : "OR"
      },
      "operation_type" : "complete",
      "topic_id" : "urn:smn:{regionid}:24edf66e79d04187acb99a463e610764:test"
    }
  • 创建自定义类型关键操作通知请求样例。

    POST https://{endpoint}/v3/{project_id}/notifications
    
    {
      "notification_name" : "keyOperate_info_cfwy",
      "operation_type" : "customized",
      "filter" : {
        "is_support_filter" : true,
        "rule" : [ "code != 200", "api_version = v1.0", "trace_rating = normal", "trace_type != ApiCall", "resource_id = xxx", "resource_name = xxx" ],
        "condition" : "OR"
      },
      "operations" : [ {
        "service_type" : "CTS",
        "resource_type" : "tracker",
        "trace_names" : [ "createTracker", "deleteTracker" ]
      }, {
        "service_type" : "CTS",
        "resource_type" : "notification",
        "trace_names" : [ "deleteNotification", "updateNotification" ]
      }, {
        "service_type" : "AOM",
        "resource_type" : "pe",
        "trace_names" : [ "deletePolicyGroup", "updatePolicyGroup", "createPolicyGroup" ]
      } ],
      "notify_user_list" : [ {
        "user_group" : "admin",
        "user_list" : [ "test1", "test2" ]
      }, {
        "user_group" : "CTS view",
        "user_list" : [ "test3", "test4" ]
      } ],
      "topic_id" : "urn:smn:{regionid}:24edf66e79d04187acb99a463e610764:test"
    }
support.huaweicloud.com/api-cts/cts_api_0312.html