Ejemplo n.º 1
0
 public virtual Response <IReadOnlyList <SubResource> > GetNamespaces(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("EventHubCluster.GetNamespaces");
     scope.Start();
     try
     {
         var response = _clustersRestClient.ListNamespaces(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         return(Response.FromValue(response.Value.Value, response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Ejemplo n.º 2
0
        public virtual Pageable <SubResource> GetNamespaces(CancellationToken cancellationToken = default)
        {
            Page <SubResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _eventHubClusterClustersClientDiagnostics.CreateScope("EventHubClusterResource.GetNamespaces");
                scope.Start();
                try
                {
                    var response = _eventHubClusterClustersRestClient.ListNamespaces(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, null, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, null));
        }