Updated on 2022-02-10 GMT+08:00

GET Bucket location

API Description

You can use this API to obtain the bucket location.

Method Definition

1. ObsClient->getBucketLocation(array $parameter)
2. ObsClient->getBucketLocationAsync(array $parameter, callable $callback)

Request Parameter

Field

Type

Optional or Mandatory

Description

Bucket

string

Mandatory

Bucket name

Returned Result

Field

Type

Description

HttpStatusCode

integer

HTTP status code

Reason

string

Reason description

RequestId

string

Request ID returned by the OBS server

Location

string

Bucket location

Sample Code

try{
       $resp = $obsClient -> getBucketLocation([
              'Bucket' => 'bucketname'
       ]);
       printf("RequestId:%s\n", $resp['RequestId']);
       printf("Location:%s\n", $resp['Location']);
}catch (Obs\Common\ObsException $obsException){
       printf("ExceptionCode:%s\n", $obsException->getExceptionCode());              
       printf("ExceptionMessage:%s\n", $obsException->getExceptionMessage());
}