OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Gets a list of all BucketSummary items in a compartment. A BucketSummary contains only summary fields for the bucket and does not 
/// contain fields like the user-defined metadata.
/// To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator. 
/// If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Gets a list of all BucketSummary items in a compartment. A BucketSummary contains only summary fields for the bucket and does not
contain fields like the user-defined metadata.
To use this and other API operations, you must be authorized in an IAM policy. If you are not authorized, talk to an administrator.
If you are an administrator who needs to write policies to give users access, see Getting Started with Policies.
Gets a list of all BucketSummary items in a compartment . A BucketSummary contains only summary fields for the bucket and does not contain fields like the user - defined metadata . To use this and other API operations you must be authorized in an IAM policy . If you are not authorized talk to an administrator . If you are an administrator who needs to write policies to give users access see Getting Started with Policies .
public async Task<ListBucketsResponse> ListBuckets(ListBucketsRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName), this.Region)}?{request.GetOptionQuery()}");
            using (var webResponse = await this.RestClientAsync.Get(uri, new HttpRequestHeaderParam() { OpcClientRequestId = request.OpcClientRequestId }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new ListBucketsResponse()
                {
                    Items = JsonSerializer.Deserialize<List<BucketSummary>>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id")
                };
            }
        }
public async Task < ListBucketsResponse > ListBuckets ( ListBucketsRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName ) , this . Region ) } ? { request . GetOptionQuery ( ) } " ) ; using ( var webResponse = await this . RestClientAsync . Get ( uri , new HttpRequestHeaderParam ( ) { OpcClientRequestId = request . OpcClientRequestId } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new ListBucketsResponse ( ) { Items = JsonSerializer . Deserialize < List < BucketSummary > > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) } ; } }
Gets a list of all BucketSummary items in a compartment.
Gets a list of all BucketSummary items in a compartment .
None
request
ListBucketsRequest
None