• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Python SDK)
  4. Initialization
  5. Configuring an Instance of ObsClient

Configuring an Instance of ObsClient

You can set the following initialization parameters to configure an instance of ObsClient:

Parameter

Description

Recommended Value

access_key_id

AK

N/A

secret_access_key

SK

N/A

is_secure

Whether to access OBS over HTTPS. The default value is True.

Default

server

Endpoint for accessing OBS.

N/A

port

Port number. The default value is 80 when HTTP is used or 443 when HTTPS is used.

N/A

max_retry_count

Maximum number of retries when an HTTP/HTTPS connection is abnormal. The default value is 3.

[1, 5]

timeout

Timeout period (in seconds) of an HTTP/HTTPS request. The default value is 60.

[10,60]

ssl_verify

Whether to verify server-side certificates. Possible values are:

  • Path to the root certificate file in .pem format on the server
  • True: The certificate list will be obtained from the root certificate library and the certificates of the operating system (Windows only) will be verified.
  • False: The server-side certificates will not be verified.

The default value is False.

N/A

chunk_size

Block size for reading and writing socket streams. The default value is 65536.

Default

long_conn_mode

Whether to enable the long connection mode. The default value is False.

N/A

proxy_host

Host address of the proxy server. This value is None by default.

N/A

proxy_port

Port number of the proxy server. This value is None by default.

N/A

proxy_username

User name used for connecting to the proxy server. This value is None by default.

N/A

proxy_password

Password used for connecting to the proxy server. This value is None by default.

N/A

NOTE:
  • Parameters whose recommended value is N/A need to be set according to the actual conditions.
  • If the network is unstable, you are advised to set a larger value for timeout.

If the long connection mode is enabled, you must call ObsClient.close to close ObsClient explicitly to reclaim connection resources.