Help Center/ Cloud Trace Service/ API Reference/ V3 APIs (Recommended)/ Other APIs/ Checking Whether Data Can Be Transferred to the Configured OBS Bucket
Updated on 2024-05-22 GMT+08:00

Checking Whether Data Can Be Transferred to the Configured OBS Bucket

Function

This API is used to check whether data can be transferred to the OBS bucket.

URI

POST /v3/{domain_id}/checkbucket

Table 1 Path parameter

Parameter

Mandatory

Type

Description

domain_id

Yes

String

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

Request Parameters

Table 2 Request body parameter

Parameter

Mandatory

Type

Description

buckets

No

Array of CheckBucketRequest objects

List of OBS buckets to be checked.

Table 3 CheckBucketRequest

Parameter

Mandatory

Type

Description

bucket_name

Yes

String

OBS bucket name. The value contains 3 to 63 characters and must start with a digit or lowercase letter. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.

bucket_location

Yes

String

OBS bucket location.

kms_id

No

String

Key ID used for encrypting transferred trace files. This parameter is mandatory when is_support_trace_files_encryption is set to true.

is_support_trace_files_encryption

No

Boolean

Whether trace files are encrypted during transfer to an OBS bucket. This parameter must be used with kms_id.

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

buckets

Array of Bucket objects

Response body for checking the OBS bucket status.

Table 5 Bucket

Parameter

Type

Description

bucket_name

String

OBS bucket name. The value contains 3 to 63 characters and must start with a digit or lowercase letter. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.

bucket_location

String

Bucket location.

kms_id

String

Key ID used for transferring and encrypting trace files. This parameter is mandatory when is_support_trace_files_encryption is set to true.

is_support_trace_files_encryption

Boolean

Whether trace files are encrypted during transfer to an OBS bucket. This parameter must be used with kms_id.

check_bucket_response

CheckBucketResponse object

Check result of the OBS bucket.

Table 6 CheckBucketResponse

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

response_code

Integer

Returned HTTP status code.

success

Boolean

Whether the transfer is successful.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Status code: 503

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code. Format: CTS.XXX.

error_msg

String

Error message.

Example Request

Example request body for checking the OBS bucket status:

GET https://{endpoint}/v3/{domain_id}/checkbucket

{
  "buckets" : [ {
    "bucket_location" : "cn-north-1",
    "bucket_name" : "bucket1",
    "is_support_trace_files_encryption" : false,
    "kms_id" : "1f26f8d8-65d4-436b-bea2-bd0ac1984f71"
  }, {
    "bucket_location" : "cn-north-2",
    "bucket_name" : "bucket2",
    "is_support_trace_files_encryption" : false,
    "kms_id" : "0c1b7d87-5186-411a-86ce-ed3b2ec848c9"
  } ]
}

Example Response

Status code: 200

The request is successfully sent.

{
  "buckets" : [ {
    "bucket_location" : "cn-north-1",
    "bucket_name" : "bucket1",
    "check_bucket_response" : {
      "response_code" : 200,
      "success" : true
    },
    "is_support_trace_files_encryption" : false,
    "kms_id" : "1f26f8d8-65d4-436b-bea2-bd0ac1984f71"
  }, {
    "bucket_location" : "cn-north-2",
    "bucket_name" : "bucket2",
    "check_bucket_response" : {
      "error_code" : "OBS.NoSuchBucket",
      "error_message" : "Error message:Request Error.OBS service Error Message.",
      "response_code" : 404,
      "success" : false
    },
    "is_support_trace_files_encryption" : false,
    "kms_id" : "0c1b7d87-5186-411a-86ce-ed3b2ec848c9"
  } ]
}

Status Codes

Status Code

Description

200

The request is successfully sent.

400

The server failed to process the request.

401

The request is rejected due to authentication failure.

403

The server understood the request but refused to authorize it.

404

The requested resource 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 Codes

For details, see Error Codes.