public virtual Response<SqlContainer> Get(CancellationToken cancellationToken = default) { using var scope = _sqlContainerSqlResourcesClientDiagnostics.CreateScope("SqlContainer.Get"); scope.Start(); try { var response = _sqlContainerSqlResourcesRestClient.GetSqlContainer(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw _sqlContainerSqlResourcesClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); return Response.FromValue(new SqlContainer(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <SqlContainer> Get(string containerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(containerName, nameof(containerName)); using var scope = _sqlContainerSqlResourcesClientDiagnostics.CreateScope("SqlContainerCollection.Get"); scope.Start(); try { var response = _sqlContainerSqlResourcesRestClient.GetSqlContainer(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, containerName, cancellationToken); if (response.Value == null) { throw _sqlContainerSqlResourcesClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new SqlContainer(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }