Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying a Trace List

Updated on 2025-02-06 GMT+08:00

Function

This API is used to query records of operations on resources in the last seven days.

API Calling

For details, see Calling APIs.

URI

GET /v3/{project_id}/traces

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining an Account ID and Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

trace_type

Yes

String

Trace type. The value can be system (management trace) or data (data trace) The default value is system.

Values:

  • system
  • data

from

No

Long

UTC millisecond timestamp of the query start time. The value contains 13 digits and the default value is the timestamp of the last hour. Traces generated after the specified timestamp will be queried. The parameters from and to should be used together.

next

No

String

This parameter is used to query traces generated earlier than its specified value. The value can be that of marker in the response. next can be used with from and to. Traces generated in the overlap of the two time ranges specified respectively by next and by from and to will be returned.

to

No

Long

UTC millisecond timestamp of the query end time. The value contains 13 digits and the default value is the timestamp of the current time. Traces generated before the specified timestamp will be queried. The parameters to and from should be used together.

tracker_name

No

String

When trace_type is set to system, the default value system is used. When trace_type is set to data, set this parameter to the name of a data tracker to query the traces recorded by this tracker.

service_type

No

String

Type of a cloud service whose traces are to be queried. The value must be the acronym of a cloud service that has been connected with CTS. It is a word composed of uppercase letters. This parameter is valid only when trace_type is set to system. For cloud services that can be connected with CTS, see section "Supported Services and Operations" in Cloud Trace Service User Guide.

user

No

String

Name of the user whose traces are to be queried This parameter is valid only when trace_type is set to system.

resource_name

No

String

Name of a resource whose traces are to be queried. This parameter is valid only when trace_type is set to system. The value can contain uppercase letters.

resource_type

No

String

Type of a resource whose traces are to be queried. This parameter is valid only when trace_type is set to system.

resource_id

No

String

ID of a cloud resource whose traces are to be queried. This parameter is valid only when trace_type is set to system.

limit

No

Integer

Number of traces to query. The default value is 10 and the maximum value is 200.

trace_id

No

String

Trace ID. If this parameter is specified, other query criteria will not take effect. This parameter is valid only when trace_type is set to system.

trace_name

No

String

Trace name. This parameter is valid only when trace_type is set to system. The value can contain uppercase letters.

trace_rating

No

String

Trace status. The value can be normal, warning, or incident. This parameter is valid only when trace_type is set to system.

Values:

  • normal
  • warning
  • incident

access_key_id

No

String

ID of the access key used to query traces. It contains temporary access credentials and permanent access keys.

enterprise_project_id

No

String

ID of an enterprise project whose traces are to be queried.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

traces

Array of Traces objects

List of returned traces.

meta_data

MetaData object

Number of returned traces and the marker.

Table 4 Traces

Parameter

Type

Description

resource_id

String

ID of a cloud resource on which the recorded operation was performed.

trace_name

String

Trace name. The value can contain 1 to 64 characters, including letters, digits, hyphens (-), underscores (_), and periods (.). It must start with a letter.

trace_rating

String

Trace status. The value can be normal, warning, or incident.

Values:

  • normal
  • warning
  • incident

trace_type

String

Trace source. For management traces, the value can be ApiCall, ConsoleAction, or SystemAction. For data traces, the value can be ObsSDK or ObsAPI.

request

String

Request of an operation on resources.

response

String

Response to a user request, that is, the returned information for an operation on resources.

code

String

HTTP status code returned by the associated API.

api_version

String

Version of the API called in a trace.

message

String

Remarks added by other cloud services to a trace.

record_time

Long

Timestamp when a trace was recorded by CTS.

trace_id

String

Trace ID. The value is the UUID generated by the system.

time

Long

Timestamp when a trace was generated.

user

UserInfo object

Information of the user who performed the operation that triggered the trace.

service_type

String

Type of a cloud service whose traces are to be queried. The value must be the acronym of a cloud service that has been connected with CTS. It is a word composed of uppercase letters.

resource_type

String

Type of the resource on which the operation was performed.

source_ip

String

IP address of the tenant who performed the operation that triggered the trace.

resource_name

String

Name of a resource on which the recorded operation was performed.

request_id

String

Request ID.

location_info

String

Additional information required for fault locating after a request error.

endpoint

String

Endpoint in the details page URL of the cloud resource on which the recorded operation was performed.

resource_url

String

Details page URL (excluding the endpoint) of the cloud resource on which the recorded operation was performed.

enterprise_project_id

String

ID of the enterprise project to which the resource belongs.

resource_account_id

String

ID of the account to which the resource belongs. This parameter has a value only when resources are operated across tenants.

read_only

boolean

Whether a user request is read-only.

operation_id

String

Operation ID of the trace.

Table 5 UserInfo

Parameter

Type

Description

id

String

User ID. For details, see section "Obtaining an Account ID and Project ID" in Cloud Trace Service API Reference.

name

String

Username.

user_name

String

Username.

domain

BaseUser object

Domain information of the user who performed the operation generating the trace.

account_id

String

Account ID. For details, see section "Obtaining an Account ID and Project ID" in Cloud Trace Service API Reference.

access_key_id

String

Access key ID.

principal_urn

String

URN of the operator.

  • For an IAM user, the format is iam::<account-id>:user:<user-name>.
  • For an IAM delegated account, the format is sts::sts::<account-id>:assumed-agency:<agency-name>/<agency-session-name>.
  • For an IAM federated identity, the format is sts::<account-id>:external-user:<idp_id>/<user-session-name>.

principal_id

String

ID of the operator.

  • For an IAM user, the format is <user-id>.
  • For an IAM delegated account, the format is <agency-id>:<agency-session-name>.
  • For an IAM federated identity, the format is <idp_id>:<user-session-name>.

principal_is_root_user

String

Whether the operator is a root user.

  • If the value is true, the operator is a root user.
  • If the value is false, the operator is an IAM delegated account, federated identity, or non-root user.

Values:

  • true
  • false

type

String

Operator identity type.

invoked_by

Array of strings

Name of the service that sends the request. For operations on the console, the value is ["service.console"].

session_context

SessionContext object

Temporary security credential attribute.

Table 6 BaseUser

Parameter

Type

Description

id

String

Account ID. For details, see section "Obtaining an Account ID and Project ID" in Cloud Trace Service API Reference.

name

String

Account name.

Table 7 SessionContext

Parameter

Type

Description

attributes

Attributes object

Temporary security credential attribute.

Table 8 Attributes

Parameter

Type

Description

created_at

String

Timestamp when a temporary security credential was issued. The value is a 13-digit UTC time in milliseconds.

mfa_authenticated

String

Whether MFA identity authentication has been passed.

Table 9 MetaData

Parameter

Type

Description

count

Integer

Number of returned traces.

marker

String

ID of the last trace in the returned trace list. The value of this parameter can be used as the next value. If the value of marker is null, all traces have been returned.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 403

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 503

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Example Request

  • Querying management traces
    GET https://{endpoint}/v3/{project_id}/traces?limit=11&to=1479095278000&from=1478490478000&trace_name=createTracker&resource_type=tracker&service_type=CTS&trace_type=system
  • Querying data traces
    GET https://{endpoint}/v3/{project_id}/traces?limit=11&to=1479095278000&from=1478490478000&trace_type=data

Example Response

Status code: 200

The request is successful.

{
  "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",
    "read_only": false,
    "operation_id": "ListSubscriptions"
  }, {
    "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",
    "read_only": false,
    "operation_id": "ListSubscriptions"
  } ]
}

Status Codes

Status Codes

Description

200

The request is successful.

400

The request is not completed due to abnormal query parameters.

401

The request is rejected due to authentication failure.

403

The server understood the request but refused to authorize it.

404

The requested trace does not exist.

500

Failed to complete the request because of an internal service error.

503

The requested service is invalid. The client should not repeat the request without modifications.

Error Code

For details, see Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback