• Cloud Trace Service

cts
  1. Help Center
  2. Cloud Trace Service
  3. API Reference
  4. API Description
  5. Tracker Management
  6. Modifying a Tracker

Modifying a Tracker

Function

Configuration items of the tracker can be modified, including Trace Transfer to OBS, Key Event Notification, and parameters for enabling and disabling a tracker. Modifying the tracker does not affect the existing operation records. After the modification is complete, the system will immediately start recording operations based on the new rule.

URI

PUT /v1.0/{project_id}/tracker/{tracker_name}

For details about the parameters, see Modifying a Tracker.
Table 1 Parameters in the URI

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

tracker_name

Yes

String

Specifies the name of a tracker. Currently, only tracker "system" is available.

Request

  • Parameters
    Table 2 Parameters in the request

    Parameter

    Sub-Parameter

    Mandatory

    Type

    Description

    bucket_name

    N/A

    Yes

    String

    Specifies the OBS bucket name. Starts with a digit or letter and contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), and periods (.)

    file_prefix_name

    N/A

    No

    String

    Specifies the prefix of a log that needs to be stored in an OBS bucket. The value is a string of 0 to 64 characters and can contain uppercase and lowercase letters (a to z and A to Z), digits (0 to 9), hyphens (-), underscores (_), or periods (.)

    status

    N/A

    No

    String

    Specifies the status of a tracker. The value can be enabled or disabled. If you change the value to disabled, the tracker stops recording traces.

    data_bucket

    data_bucket_name

    Yes

    Array

    Specifies the bucket name of the data class tracker.

    • This parameter is mandatory whenever the data class tracker is enabled or disabled.
    • This parameter is not invalid for the management class tracker.

    data_event

    Yes

    Array

    Specifies the type of operations tracked by the data tracker.

    • This parameter is mandatory whenever the data class tracker is enabled or disabled.
    • This parameter is not invalid for the management class tracker.

    search_enabled

    Yes

    Boolean

    Specifies whether to enable trace analysis for the data tracker.

    • This parameter is mandatory whenever the data class tracker is enabled or disabled.
    • This parameter is not invalid for the management class tracker.

    smn

    is_support_smn

    No

    Boolean

    Specifies whether SMN is supported. When the value is false, topic_id and operations can be left empty.

    topic_id

    No

    String

    topic_id is obtained from SMN and in the format of urn:smn:([a-z]|[A-Z]|[0-9]|\-){1,32}:([a-z]|[A-Z]|[0-9]){32}:([a-z]|[A-Z]|[0-9]|\-|\_){1,256}.

    operations

    Yes

    Array

    • Specifies trigger conditions for sending a notification when Typical is selected. You can select Delete, Create, or Login or at least one of them.
    • Specifies trigger conditions for sending a notification when All is selected. All conditions including Delete, Create, Change, and OpenStack API Event are selected by default. Modification is not allowed.

    is_send_all_key_operation

    Yes

    Boolean

    You can select Typical or All for Trigger Condition.

    • When the value is false, operations cannot be left empty.
    • When the value is true, operations is not supported.

    need_notify_user_list

    No

    Array

    In Typical scenario, you can specify the users using the login function. When these users log in, notifications will be sent.

    • After this function is enabled, the value is the list of those users. Separate them with a comma (,). A maximum of 50 users is supported.
    • If the value is null, the target objects are all users by default.
  • Example request
    PUT /v1.0/{project_id}/tracker/system   
    { 
     "bucket_name" : "my_created_bucket", 
     "file_prefix_name" : "some_folder", 
     "smn": {
      "is_support_smn": true,
      "topic_id": "urn:smn:regionId:ea79855fbe0642718cb4df1551c3cb4e:hh",
      "is_send_all_key_operation":false,
      "operations": ["delete","create","login"],
      "need_notify_user_list": ["user1","user2"]
     },
      "status" : "disabled"   
    }

Response

  • Parameters
    Table 3 Parameters in the response

    Parameter

    Sub-Parameter

    Type

    Description

    tracker_name

    N/A

    String

    Specifies the tracker name. Currently, only tracker "system" is available.

    bucket_name

    N/A

    String

    Specifies the OBS bucket name. Starts with a digit or letter and contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), and periods (.)

    file_prefix_name

    N/A

    String

    Specifies the prefix of a log that needs to be stored in an OBS bucket.

    status

    N/A

    String

    Specifies the status of a tracker. The value can be enabled or disabled.

    smn

    is_support_smn

    Boolean

    Specifies whether SMN is supported.

    topic_id

    String

    Specifies the theme of the SMN service.

    operations

    Array

    • Specifies trigger conditions for sending a notification when Typical is selected. You can select Delete, Create, or Login or at least one of them.
    • Specifies trigger conditions for sending a notification when All is selected. All conditions including Delete, Create, Change, and OpenStack API Event are selected by default. Modification is not allowed.

    is_send_all_key_operation

    Boolean

    You can select Typical or All for Trigger Condition.

    • When the value is false, operations cannot be left empty.
    • When the value is true, operations is not supported.

    need_notify_user_list

    Array

    In Typical scenario, you can specify the users using the login function. When these users log in, notifications will be sent.

    • After this function is enabled, the value is the list of the specified users. Separate them with a comma (,). A maximum of 50 users is supported.
    • If the value is null, the target objects are all users by default.
  • Example response
{ 
 "bucket_name" : "my_created_bucket", 
 "tracker_name" : "system", 
 "file_prefix_name" : "some_folder", 
 "smn": {
  "is_support_smn": true,
  "topic_id": "urn:smn:regionId:ea79855fbe0642718cb4df1551c3cb4e:hh",
  "is_send_all_key_operation":false,
  "operations": ["delete","create","login"],
  "need_notify_user_list": ["user1","user2"]
 }
 "status" : "disabled" 
}

Returned Value

  • Normal
    Table 4 Return code for successful requests

    Returned Value

    Description

    200

    The request is successfully processed.

  • Abnormal
    Table 5 Return code for failed requests

    Returned Value

    Description

    400

    The server failed to process the request.

    404

    The server failed to find the requested resource.

    500

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

    401

    Your access request is rejected.

    403

    You are forbidden to access the requested page.