Updated on 2026-08-03 GMT+08:00

obs_options

Table 1 obs_options

Parameter

Type

Mandatory (Yes/No)

Description

bucket_options

obs_bucket_context

Yes

Explanation:

Bucket settings.

Restrictions:

None

Value range:

None

Default value:

None

request_options

obs_http_request_option

Yes

Explanation:

Request-related settings.

Restrictions:

None

Value range:

None

Default value:

None

temp_auth

temp_auth_configure*

No

Explanation:

The structure used to calculate a temporary signature. Set it to NULL if it is not used.

Restrictions:

None

Value range:

None

Default value:

None

Table 2 obs_bucket_context

Parameter

Type

Mandatory (Yes/No)

Description

host_name

char *

Yes

Explanation:

The requested host name, used as an address for connecting to OBS. It is the domain name (the endpoint) of the server where the requested resource is stored.

Example: host_name = "obs.ap-southeast-1.myhuaweicloud.com";

To view the endpoints available for OBS, see Regions and Endpoints.

Restrictions:

The value does not need to contain http:// or https:// as a prefix, which is controlled using obs_protocol.

Default value:

None

bucket_name

char *

Yes

Explanation:

Bucket name.

Restrictions:

  • A bucket name must be unique across all accounts and regions.
  • A bucket name:
    • Must be 3 to 63 characters long and start with a digit or letter. Lowercase letters, digits, hyphens (-), and periods (.) are allowed.
    • Cannot be an IP address.
    • Cannot start or end with a hyphen (-) or period (.).
    • Cannot contain two consecutive periods (..), for example, my..bucket.
    • Cannot contain a period (.) and a hyphen (-) adjacent to each other, for example, my-.bucket or my.-bucket.
  • If you repeatedly create buckets with the same name in the same region, no error will be reported and the bucket attributes comply with those set in the first creation request.

Default value:

None

useCname

bool

No

Explanation:

Whether to use a custom domain name to access OBS.

Restrictions:

None

Value range:

true: A custom domain name is used.

false: A custom domain name is not used.

Default value:

false

protocol

obs_protocol

No

Explanation:

Whether to use the HTTP or HTTPS protocol.

Restrictions:

None

Default value:

OBS_PROTOCOL_HTTPS (HTTPS is used by default.)

access_key

char *

Yes

Explanation:

Access key ID (AK).

Restrictions:

None

Value range:

None

Default value:

None

secret_access_key

char *

Yes

Explanation:

Secret access key (SK).

Restrictions:

None

Value range:

None

Default value:

None

storage_class

obs_storage_class

No

Explanation:

Bucket storage class that can be specified at bucket creation.

Value range:

See obs_storage_class.

Default value:

OBS_STORAGE_CLASS_STANDARD (Standard storage class)

token

char *

No

Explanation:

The security token in temporary credentials.

Restrictions:

None

Value range:

None

Default value:

None

epid

char *

No

Explanation:

Enterprise project ID that can be specified during bucket creation. Users who have enabled the enterprise project function can obtain the ID from the enterprise project service.

Restrictions:

The value needs to be represented as a UUID. This parameter is not required if EPS is not enabled.

Example: 9892d768-2d13-450f-aac7-ed0e44c2585f

Default value:

None

bucket_type

obs_bucket_type

No

Explanation:

Whether a bucket is an object bucket or a parallel file system.

Restrictions:

None

Default value:

OBS_BUCKET_OBJECT (object bucket)

bucket_list_type

obs_bucket_list_type

No

Explanation:

Whether to list all buckets, object buckets, or parallel file systems.

Restrictions:

None

Table 3 obs_http_request_option

Parameter

Type

Mandatory (Yes/No)

Description

connect_time

int

Yes

Explanation:

Timeout period for establishing an HTTP/HTTPS connection, in ms.

Restrictions:

None

Value range:

[10000, 60000]

Default value:

60000

max_connected_time

int

Yes

Explanation:

Timeout period (in seconds) of a request.

Restrictions:

None

Value range:

None

Default value:

0 (There is never automatic disconnection.)

proxy_auth

char*

No

Explanation:

Proxy authentication information, in the format username:password

Restrictions:

None

Value range:

None

Default value:

None

proxy_host

char*

No

Explanation:

IP address or host name of the proxy server.

Restrictions:

None

Value range:

None

Default value:

None

Table 4 obs_protocol

Constant

Original Value

Description

OBS_PROTOCOL_HTTPS

https

HTTPS is used for access.

OBS_PROTOCOL_HTTP

http

HTTP is used for access.

Table 5 obs_bucket_type

Constant

Original Value

Description

OBS_BUCKET_OBJECT

OBJECT

Object buckets.

OBS_BUCKET_PFS

POSIX

Parallel file systems.

Table 6 obs_bucket_list_type

Constant

Original Value

Description

OBS_BUCKET_LIST_ALL

No header is sent.

Lists all buckets.

OBS_BUCKET_LIST_OBJECT

OBJECT

Lists all object buckets.

OBS_BUCKET_LIST_PFS

POSIX

Lists all parallel file systems.

Table 7 temp_auth_configure

Parameter

Type

Mandatory (Yes/No)

Description

expires

long long int

Yes

Explanation:

Validity period of the temporary credentials, in seconds.

Restrictions:

None

Value range:

[0-630720000]

Default value:

None

temp_auth_callback

void (*temp_auth_callback)(char *, uint64_t, char *, uint64_t, void *)

Yes

Explanation:

The pointer to the custom callback function, which is used to record the temporary URL and involved signature header to the custom callback data.

Restrictions:

None

Value range:

None

Default value:

None

callback_data

void *

Yes

Explanation:

Custom callback data.

Restrictions:

None

Value range:

None

Default value:

None

Table 8 temp_auth_callback

Parameter

Type

Mandatory (Yes/No)

Description

temp_auth_url

char *

Yes

Explanation:

Temporary URL. OBS allows you to construct a URL for a specific operation. In such a URL, you use Query parameters to provide authentication information including the user AK, signature, and validity period. Anyone who has the URL can perform the specified operation. After receiving a request made using such a URL, OBS treats the requester as the user who issued the URL and processes the request. For example, if you construct a pre-signed URL for downloading an object and provide it to various users, they can use the URL to download the object without authentication, but they must do so within the validity period specified by the Expires parameter.

Restrictions:

None

Value range:

None

Default value:

None

temp_auth_url_len

uint64_t

Yes

Explanation:

Length of the temporary URL.

Restrictions:

None

Value range:

None

Default value:

None

temp_auth_headers

char *

Yes

Explanation:

Headers for temporary authentication.

Restrictions:

None

Value range:

None

Default value:

None

temp_auth_headers_len

uint64_t

Yes

Explanation:

Length of the buffer for temporary authentication headers, in bytes.

Restrictions:

None

Value range:

None

Default value:

None

callback_data

void *

Yes

Explanation:

Custom callback data.

Restrictions:

None

Value range:

None

Default value:

None