Updated on 2025-12-19 GMT+08:00

Authorizing Cloud Storage

Function

This API is used to authorize cloud storage.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

POST /v1/{project_id}/cae/volumes

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. See Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

  • When an environment is created, it will be bound with an enterprise project ID.

  • Enter 0 or up to 36 characters in UUID format with hyphens (-).

  • If this parameter is not specified or is set to 0, resources in the default enterprise project are queried.

NOTE:
For details about how to obtain enterprise project IDs and enterprise project features, see Enterprise Management User Guide.

X-Environment-ID

Yes

String

Environment ID.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

api_version

Yes

String

API version. Fixed value: v1.

kind

Yes

String

API type. Fixed value: Volume.

spec

Yes

VolumeSpec object

Volume specifications.

Table 4 VolumeSpec

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Definition

Resource type. Options: OBS and SFS.

Range

  • obs

  • sfs

Default Value

N/A

resource_sub_type

Yes

String

Definition

Object storage type.

Range

  • parallel_file_system

  • object_bucket

  • sfs3.0

Default Value

N/A

resources

Yes

Array of strings

Cloud storage name.

resources_credentials

No

Array of ResourcesCredential objects

Cloud storage and authorization credential. This parameter needs to be added when the env_category field in the response of the API for obtaining the environment list is v2.

Table 5 ResourcesCredential

Parameter

Mandatory

Type

Description

access

No

String

User access key. The current access key must have the permission to access the authorized cloud storage.

secret

No

String

User secret key. The current secret key must have the permission to access the authorized cloud storage.

Response Parameters

Status code: 200

OK

None

Example Requests

Authorize cloud storage: Set resource_type to obs and resources to test-bucket.

POST https://{endpoint}/v1/{project_id}/cae/volumes

{
  "api_version" : "v1",
  "kind" : "Volume",
  "spec" : {
    "resource_type" : "obs",
    "resource_sub_type" : "object_bucket",
    "resources" : [ "test-bucket" ],
    "resources_credentials" : [ {
      "access" : "xxx",
      "secret" : "xxx",
      "resources" : [ "test-bucket" ]
    } ]
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.