public RemoveRouteTableFromSubnet(IRouteOperations routeOperations, string vnetName, string subnetName)
        {
            this.routeOperations = routeOperations;
            this.vnetName = vnetName;
            this.subnetName = subnetName;

            oldAssignedRouteTableName = RouteTestClient.GetRouteTableAssignedToSubnet(routeOperations, vnetName, subnetName);
        }
        public DeleteRoute(IRouteOperations routeOperations, string routeTableName, string routeName)
        {
            this.routeOperations = routeOperations;
            this.routeTableName = routeTableName;
            this.routeName = routeName;

            oldRouteTable = RouteTestClient.GetRouteTableSafe(routeOperations, routeTableName);
        }
Beispiel #3
0
        public SetRoute(IRouteOperations routeOperations, string routeTableName, string routeName, SetRouteParameters parameters)
        {
            this.routeOperations = routeOperations;
            this.routeTableName = routeTableName;
            this.routeName = routeName;
            this.parameters = parameters;

            oldRouteTable = RouteTestClient.GetRouteTableSafe(routeOperations, routeTableName);
        }
        public DeleteRouteTable(IRouteOperations routeOperations, string routeTableName)
        {
            this.routeOperations = routeOperations;
            this.routeTableName = routeTableName;

            if (string.IsNullOrEmpty(routeTableName))
            {
                oldRouteTable = null;
            }
            else
            {
                oldRouteTable = RouteTestClient.GetRouteTableSafe(routeOperations, routeTableName);
            }
        }
        public RouteTestClient(NetworkTestClient testClient, IRouteOperations routeOperations)
        {
            if (testClient == null)
            {
                throw new ArgumentNullException("testClient");
            }
            if (routeOperations == null)
            {
                throw new ArgumentNullException("routeOperations");
            }

            this.testClient = testClient;
            this.routeOperations = routeOperations;
        }
        public CreateRouteTable(IRouteOperations routeOperations, CreateRouteTableParameters parameters)
        {
            this.routeOperations = routeOperations;
            this.parameters = parameters;

            if (parameters == null || string.IsNullOrEmpty(parameters.Name))
            {
                tableExistedPreviously = false;
            }
            else
            {
                RouteTable routeTable = RouteTestClient.GetRouteTableSafe(routeOperations, parameters.Name);
                tableExistedPreviously = (routeTable != null);    
            }
        }
        public AddRouteTableToSubnet(IRouteOperations routeOperations, string vnetName, string subnetName, AddRouteTableToSubnetParameters parameters)
        {
            this.routeOperations = routeOperations;
            this.vnetName = vnetName;
            this.subnetName = subnetName;
            this.parameters = parameters;

            if (parameters == null || string.IsNullOrEmpty(parameters.RouteTableName))
            {
                routeTableAssignedPreviously = false;
            }
            else
            {
                string assignedRouteTable = RouteTestClient.GetRouteTableAssignedToSubnet(routeOperations, vnetName, subnetName);
                routeTableAssignedPreviously = string.Equals(parameters.RouteTableName, assignedRouteTable, StringComparison.InvariantCultureIgnoreCase);
            }
        }
Beispiel #8
0
 /// <summary>
 /// Set the specified route table for the provided subnet in the
 /// provided virtual network in this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='vnetName'>
 /// Required. The name of the virtual network that contains the
 /// provided subnet.
 /// </param>
 /// <param name='subnetName'>
 /// Required. The name of the subnet that the route table will be added
 /// to.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters necessary to add a route table to the
 /// provided subnet.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> BeginAddRouteTableToSubnetAsync(this IRouteOperations operations, string vnetName, string subnetName, AddRouteTableToSubnetParameters parameters)
 {
     return(operations.BeginAddRouteTableToSubnetAsync(vnetName, subnetName, parameters, CancellationToken.None));
 }
Beispiel #9
0
 /// <summary>
 /// The Put route operation creates/updates a route in the specified
 /// route table
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table.
 /// </param>
 /// <param name='routeName'>
 /// Required. The name of the route.
 /// </param>
 /// <param name='routeParameters'>
 /// Required. Parameters supplied to the create/update route operation
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request and error information regarding
 /// the failure.
 /// </returns>
 public static Task <AzureAsyncOperationResponse> CreateOrUpdateAsync(this IRouteOperations operations, string resourceGroupName, string routeTableName, string routeName, Route routeParameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters, CancellationToken.None));
 }
Beispiel #10
0
 /// <summary>
 /// Set the specified route for the provided table in this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table where the provided route will
 /// be set.
 /// </param>
 /// <param name='routeName'>
 /// Required. The name of the route that will be set on the provided
 /// route table.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters necessary to create a new route table.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <OperationStatusResponse> SetRouteAsync(this IRouteOperations operations, string routeTableName, string routeName, SetRouteParameters parameters)
 {
     return(operations.SetRouteAsync(routeTableName, routeName, parameters, CancellationToken.None));
 }
Beispiel #11
0
 /// <summary>
 /// The delete route operation deletes the specified route from a route
 /// table.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table.
 /// </param>
 /// <param name='routeName'>
 /// Required. The name of the route.
 /// </param>
 /// <returns>
 /// If the resource provide needs to return an error to any operation,
 /// it should return the appropriate HTTP error code and a message
 /// body as can be seen below.The message should be localized per the
 /// Accept-Language header specified in the original request such
 /// thatit could be directly be exposed to users
 /// </returns>
 public static Task <UpdateOperationResponse> BeginDeletingAsync(this IRouteOperations operations, string resourceGroupName, string routeTableName, string routeName)
 {
     return(operations.BeginDeletingAsync(resourceGroupName, routeTableName, routeName, CancellationToken.None));
 }
Beispiel #12
0
 /// <summary>
 /// List the existing route tables for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <ListRouteTablesResponse> ListRouteTablesAsync(this IRouteOperations operations)
 {
     return(operations.ListRouteTablesAsync(CancellationToken.None));
 }
Beispiel #13
0
 /// <summary>
 /// Delete the specified route table for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> BeginDeleteRouteTableAsync(this IRouteOperations operations, string routeTableName)
 {
     return(operations.BeginDeleteRouteTableAsync(routeTableName, CancellationToken.None));
 }
Beispiel #14
0
 /// <summary>
 /// Get the specified route table for the provided subnet in the
 /// provided virtual network in this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='vnetName'>
 /// Required. The name of the virtual network that contains the
 /// provided subnet.
 /// </param>
 /// <param name='subnetName'>
 /// Required. The name of the subnet.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <GetRouteTableForSubnetResponse> GetRouteTableForSubnetAsync(this IRouteOperations operations, string vnetName, string subnetName)
 {
     return(operations.GetRouteTableForSubnetAsync(vnetName, subnetName, CancellationToken.None));
 }
        public static RouteTable GetRouteTableSafe(IRouteOperations routeOperations, string routeTableName)
        {
            RouteTable retval = null;

            try
            {
                retval = routeOperations.GetRouteTableWithDetails(routeTableName, "full").RouteTable;
            }
            catch (Hyak.Common.CloudException e)
            {
                if (e.Error.Code != "ResourceNotFound")
                {
                    throw;
                }
            }

            return retval;
        }
Beispiel #16
0
 /// <summary>
 /// Get the specified route table for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table in this subscription to
 /// retrieve.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <GetRouteTableResponse> GetRouteTableAsync(this IRouteOperations operations, string routeTableName)
 {
     return(operations.GetRouteTableAsync(routeTableName, CancellationToken.None));
 }
Beispiel #17
0
 /// <summary>
 /// Delete the specified route table for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table to delete.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <OperationStatusResponse> DeleteRouteTableAsync(this IRouteOperations operations, string routeTableName)
 {
     return(operations.DeleteRouteTableAsync(routeTableName, CancellationToken.None));
 }
Beispiel #18
0
 /// <summary>
 /// Create the specified route table for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters necessary to create a new route table.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <OperationStatusResponse> CreateRouteTableAsync(this IRouteOperations operations, CreateRouteTableParameters parameters)
 {
     return(operations.CreateRouteTableAsync(parameters, CancellationToken.None));
 }
        public static string GetRouteTableAssignedToSubnet(IRouteOperations routeOperations, string vnetName, string subnetName)
        {
            string routeTableName = null;

            try
            {
                routeTableName = routeOperations.GetRouteTableForSubnet(vnetName, subnetName).RouteTableName;
            }
            catch (Hyak.Common.CloudException e)
            {
                if (e.Error.Code != "ResourceNotFound")
                {
                    throw;
                }
            }

            return routeTableName;
        }
Beispiel #20
0
 /// <summary>
 /// Remove the route table from the provided subnet in the provided
 /// virtual network in this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='vnetName'>
 /// Required. The name of the virtual network that contains the
 /// provided subnet.
 /// </param>
 /// <param name='subnetName'>
 /// Required. The name of the subnet that the route table will be
 /// removed from.
 /// </param>
 /// <returns>
 /// The response body contains the status of the specified asynchronous
 /// operation, indicating whether it has succeeded, is inprogress, or
 /// has failed. Note that this status is distinct from the HTTP status
 /// code returned for the Get Operation Status operation itself. If
 /// the asynchronous operation succeeded, the response body includes
 /// the HTTP status code for the successful request. If the
 /// asynchronous operation failed, the response body includes the HTTP
 /// status code for the failed request, and also includes error
 /// information regarding the failure.
 /// </returns>
 public static Task <OperationStatusResponse> RemoveRouteTableFromSubnetAsync(this IRouteOperations operations, string vnetName, string subnetName)
 {
     return(operations.RemoveRouteTableFromSubnetAsync(vnetName, subnetName, CancellationToken.None));
 }
Beispiel #21
0
 /// <summary>
 /// Get the specified route table for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='routeTableName'>
 /// Required. The name of the route table in this subscription to
 /// retrieve.
 /// </param>
 /// <param name='detailLevel'>
 /// Required. The amount of detail about the requested route table that
 /// will be returned.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <GetRouteTableResponse> GetRouteTableWithDetailsAsync(this IRouteOperations operations, string routeTableName, string detailLevel)
 {
     return(operations.GetRouteTableWithDetailsAsync(routeTableName, detailLevel, CancellationToken.None));
 }
Beispiel #22
0
 /// <summary>
 /// Create the specified route table for this subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Network.IRouteOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters necessary to create a new route table.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> BeginCreateRouteTableAsync(this IRouteOperations operations, CreateRouteTableParameters parameters)
 {
     return(operations.BeginCreateRouteTableAsync(parameters, CancellationToken.None));
 }