OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Gets the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.
/// Any user with the NAMESPACE_READ permission will be able to see the current metadata. 
/// 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 the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.
Any user with the NAMESPACE_READ permission will be able to see the current metadata.
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 the metadata for the Object Storage namespace which contains defaultS3CompartmentId and defaultSwiftCompartmentId . Any user with the NAMESPACE_READ permission will be able to see the current metadata . 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<GetNamespaceMetadataResponse> GetNamespaceMetadata(GetNamespaceMetadataRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Namespace, this.Region)}/{request.NamespaceName}");
            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 GetNamespaceMetadataResponse()
                {
                    NamespaceMetadata = JsonSerializer.Deserialize<NamespaceMetadata>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id")
                };
            }
        }
public async Task < GetNamespaceMetadataResponse > GetNamespaceMetadata ( GetNamespaceMetadataRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Namespace , this . Region ) } / { request . NamespaceName } " ) ; 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 GetNamespaceMetadataResponse ( ) { NamespaceMetadata = JsonSerializer . Deserialize < NamespaceMetadata > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) } ; } }
Gets the metadata for the Object Storage namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.
Gets the metadata for the Object Storage namespace which contains defaultS3CompartmentId and defaultSwiftCompartmentId .
None
request
GetNamespaceMetadataRequest
None