コード例 #1
0
 public virtual Response <RouteTable> Get(string expand = null, CancellationToken cancellationToken = default)
 {
     using var scope = _routeTableClientDiagnostics.CreateScope("RouteTable.Get");
     scope.Start();
     try
     {
         var response = _routeTableRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken);
         if (response.Value == null)
         {
             throw new RequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new RouteTable(Client, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
コード例 #2
0
        public virtual Response <RouteTable> Get(string routeTableName, string expand = null, CancellationToken cancellationToken = default)
        {
            using var scope = _clientDiagnostics.CreateScope("RouteTableCollection.Get");
            scope.Start();
            try
            {
                if (routeTableName == null)
                {
                    throw new ArgumentNullException(nameof(routeTableName));
                }

                var response = _restClient.Get(Id.ResourceGroupName, routeTableName, expand, cancellationToken: cancellationToken);
                if (response.Value == null)
                {
                    throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new RouteTable(Parent, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }