Esempio n. 1
0
 public virtual Response <EventHubClusterResource> Get(CancellationToken cancellationToken = default)
 {
     using var scope = _eventHubClusterClustersClientDiagnostics.CreateScope("EventHubClusterResource.Get");
     scope.Start();
     try
     {
         var response = _eventHubClusterClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         if (response.Value == null)
         {
             throw new RequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new EventHubClusterResource(Client, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Esempio n. 2
0
        public virtual Response <EventHubCluster> Get(string clusterName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName));

            using var scope = _eventHubClusterClustersClientDiagnostics.CreateScope("EventHubClusterCollection.Get");
            scope.Start();
            try
            {
                var response = _eventHubClusterClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, clusterName, cancellationToken);
                if (response.Value == null)
                {
                    throw new RequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new EventHubCluster(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }