public virtual Response <BlobContainer> Get(string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); using var scope = _blobContainerClientDiagnostics.CreateScope("BlobContainerCollection.Get"); scope.Start(); try { var response = _blobContainerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, containerName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new BlobContainer(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <BlobContainer> Get(string containerName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.Get"); scope.Start(); try { if (containerName == null) { throw new ArgumentNullException(nameof(containerName)); } var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, Id.Name, containerName, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new BlobContainer(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <BlobContainer> Get(CancellationToken cancellationToken = default) { using var scope = _blobContainerClientDiagnostics.CreateScope("BlobContainer.Get"); scope.Start(); try { var response = _blobContainerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _blobContainerClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new BlobContainer(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }