/// <summary>
        /// Creates a new firewall rule on the specified server.
        /// </summary>
        /// <param name="proxy">
        /// Channel used for communication with Azure's service management APIs.
        /// </param>
        /// <param name="subscriptionId">
        /// The subscription id which contains the server.
        /// </param>
        /// <param name="serverName">
        /// The name of the server in which to create the firewall rule.
        /// </param>
        /// <param name="ruleName">
        /// The name of the new firewall rule.
        /// </param>
        /// <param name="startIpAddress">
        /// The starting IP address for the firewall rule.
        /// </param>
        /// <param name="endIpAddress">
        /// The ending IP address for the firewall rule.
        /// </param>
        public static void NewServerFirewallRule(this ISqlDatabaseManagement proxy, string subscriptionId, string serverName, string ruleName, string startIpAddress, string endIpAddress)
        {
            var input = new SqlDatabaseFirewallRuleInput
            {
                Name = ruleName,
                StartIPAddress = startIpAddress,
                EndIPAddress = endIpAddress
            };

            proxy.EndNewServerFirewallRule(proxy.BeginNewServerFirewallRule(subscriptionId, serverName, input, null, null));
        }
        /// <summary>
        /// Updates a firewall rule on the specified server.
        /// </summary>
        /// <param name="proxy">
        /// Channel used for communication with Azure's service management APIs.
        /// </param>
        /// <param name="subscriptionId">
        /// The subscription id which contains the server.
        /// </param>
        /// <param name="serverName">
        /// The name of the server containing the firewall rule.
        /// </param>
        /// <param name="ruleName">
        /// The name of the firewall rule to update.
        /// </param>
        /// <param name="startIpAddress">
        /// The starting IP address for the firewall rule.
        /// </param>
        /// <param name="endIpAddress">
        /// The ending IP address for the firewall rule.
        /// </param>
        public static void UpdateServerFirewallRule(this ISqlDatabaseManagement proxy, string subscriptionId, string serverName, string ruleName, string startIpAddress, string endIpAddress)
        {
            var input = new SqlDatabaseFirewallRuleInput
            {
                Name           = ruleName,
                StartIPAddress = startIpAddress,
                EndIPAddress   = endIpAddress
            };

            proxy.EndUpdateServerFirewallRule(proxy.BeginUpdateServerFirewallRule(subscriptionId, serverName, ruleName, input, null, null));
        }
 public IAsyncResult BeginUpdateServerFirewallRule(string subscriptionId, string serverName, string ruleName, SqlDatabaseFirewallRuleInput input, AsyncCallback callback, object state)
 {
     SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();
     result.Values["subscriptionId"] = subscriptionId;
     result.Values["serverName"] = serverName;
     result.Values["ruleName"] = ruleName;
     result.Values["input"] = input;
     result.Values["callback"] = callback;
     result.Values["state"] = state;
     return result;
 }
Beispiel #4
0
        public IAsyncResult BeginUpdateServerFirewallRule(string subscriptionId, string serverName, string ruleName, SqlDatabaseFirewallRuleInput input, AsyncCallback callback, object state)
        {
            SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();

            result.Values["subscriptionId"] = subscriptionId;
            result.Values["serverName"]     = serverName;
            result.Values["ruleName"]       = ruleName;
            result.Values["input"]          = input;
            result.Values["callback"]       = callback;
            result.Values["state"]          = state;
            return(result);
        }