Help Center/ Cloud Trace Service/ API Reference/ Examples/ Example 3: Querying Management Traces
Updated on 2023-07-21 GMT+08:00

Example 3: Querying Management Traces

Introduction

This section describes how to query all management traces of an account in the last hour.

Other Involved APIs

None

Querying Management Traces

  • URI:

    GET /v3/{project_id}/traces

  • Example request:

    GET https://{cts_endpoint}/v3/{project_id} /traces?trace_type=system

    Obtain the value of {cts_endpoint} from Regions and Endpoints.

  • Example response:
    {
      "meta_data" : {
        "count" : 2,
        "marker" : "e001ccb8-bc09-11e6-b2cc-2640a43cc6e8"
      },
      "traces" : [ {
        "time" : 1472148708232,
        "user" : {
          "name" : "xxx",
          "domain" : {
            "name" : "xxx",
            "id" : "ded649d814464428ba89d04d7955c93e"
          }
        },
        "response" : {
          "code" : "VPC.0514",
          "message" : "Update port fail."
        },
        "code" : 200,
        "service_type" : "VPC",
        "resource_type" : "eip",
        "resource_name" : "192.144.163.1",
        "resource_id" : "d502809d-0d1d-41ce-9690-784282142ccc",
        "trace_name" : "deleteEip",
        "trace_rating" : "warning",
        "trace_type" : "ConsoleAction",
        "api_version" : "2.0",
        "record_time" : 1481066128032,
        "trace_id" : "e001ccb9-bc09-11e6-b00b-4b2a61338db6"
      }, {
        "time" : 1472148708232,
        "user" : {
          "name" : "xxx",
          "domain" : {
            "name" : "xxx",
            "id" : "ded649d814464428ba89d04d7955c93e"
          }
        },
        "response" : {
          "code" : "VPC.0514",
          "message" : "Update port fail."
        },
        "code" : 200,
        "service_type" : "VPC",
        "resource_type" : "eip",
        "resource_name" : "192.144.163.1",
        "resource_id" : "d502809d-0d1d-41ce-9690-784282142ccc",
        "trace_name" : "deleteEip",
        "trace_rating" : "warning",
        "trace_type" : "ConsoleAction",
        "api_version" : "2.0",
        "record_time" : 1481066128032,
        "trace_id" : "e001ccb8-bc09-11e6-b2cc-2640a43cc6e8"
      } ]
    }