Help Center/ SparkRTC/ API Reference/ OBS Bucket Management/ Authorizing and Canceling OBS Bucket Authorization
Updated on 2025-02-08 GMT+08:00

Authorizing and Canceling OBS Bucket Authorization

Function

Authorize and cancel OBS bucket authorization.

URI

PUT /v2/rtc-ops/buckets/authentication

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API that is used for obtaining a user token. The value of X-Subject-Token in the response header is the user token.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

bucket

Yes

String

OBS bucket name.

operation

Yes

Integer

Operation. The options are as follows: 1: authorize; 0: cancel authorization.

location

Yes

String

Region where a bucket resides.

  • cn-north-4
  • cn-north-1
  • cn-north-5
  • cn-north-6
  • cn-south-1
  • cn-east-2

project_id

No

String

HUAWEI CLOUD project ID of the tenant.

Response Parameters

Status code: 200

Table 3 Response header parameters

Parameter

Type

Description

X-request-Id

String

This field carries the request ID for task tracing.

Status code: 400

Table 4 Response header parameters

Parameter

Type

Description

X-request-Id

String

This field carries the request ID for task tracing.

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Description.

Status code: 401

Table 6 Response header parameters

Parameter

Type

Description

X-request-Id

String

This field carries the request ID for task tracing.

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Description.

Status code: 500

Table 8 Response header parameters

Parameter

Type

Description

X-request-Id

String

This field carries the request ID for task tracing.

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Description.

Example Requests

Permission authorization: bucket001; location: cn-north-4

POST https://rtc-api.myhuaweicloud.com/rtc-ops/buckets/authentication

{
  "bucket" : "bucket001",
  "operation" : 1,
  "location" : "cn-north-4"
}

Example Responses

Status code: 400

Operation failed.

{
  "error_code" : "RTC.00001003",
  "error_msg" : "InvalidParameterValue"
}

Status code: 401

The request fails because the X-Auth-Token is incorrect.

{
  "error_code" : "RTC.00001003",
  "error_msg" : "InvalidParameterValue"
}

Status code: 500

Query failed. Server error.

{
  "error_code" : "RTC.00002xxx",
  "error_msg" : "InternalError"
}

Status Codes

Status Code

Description

200

Operation succeeded.

400

Operation failed.

401

The request fails because the X-Auth-Token is incorrect.

500

Query failed. Server error.

Error Codes

See Error Codes.