azure_mgmt_sql 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_sql.rb +124 -41
- data/lib/generated/azure_mgmt_sql/capabilities.rb +115 -0
- data/lib/generated/azure_mgmt_sql/databases.rb +2877 -443
- data/lib/generated/azure_mgmt_sql/elastic_pools.rb +407 -30
- data/lib/generated/azure_mgmt_sql/failover_groups.rb +1143 -0
- data/lib/generated/azure_mgmt_sql/firewall_rules.rb +443 -0
- data/lib/generated/azure_mgmt_sql/models/authentication_type.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/backup_long_term_retention_policy.rb +94 -0
- data/lib/generated/azure_mgmt_sql/models/backup_long_term_retention_policy_state.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/backup_long_term_retention_vault.rb +80 -0
- data/lib/generated/azure_mgmt_sql/models/{transparent_data_encryption_states.rb → blob_auditing_policy_state.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/capability_status.rb +18 -0
- data/lib/generated/azure_mgmt_sql/models/check_name_availability_reason.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/check_name_availability_request.rb +59 -0
- data/lib/generated/azure_mgmt_sql/models/check_name_availability_response.rb +84 -0
- data/lib/generated/azure_mgmt_sql/models/create_mode.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/data_masking_function.rb +20 -0
- data/lib/generated/azure_mgmt_sql/models/data_masking_policy.rb +131 -0
- data/lib/generated/azure_mgmt_sql/models/data_masking_rule.rb +226 -0
- data/lib/generated/azure_mgmt_sql/models/data_masking_rule_list_result.rb +54 -0
- data/lib/generated/azure_mgmt_sql/models/data_masking_rule_state.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/{server_state.rb → data_masking_state.rb} +4 -4
- data/lib/generated/azure_mgmt_sql/models/database.rb +115 -63
- data/lib/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +156 -0
- data/lib/generated/azure_mgmt_sql/models/{database_editions.rb → database_edition.rb} +4 -3
- data/lib/generated/azure_mgmt_sql/models/database_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/database_security_alert_policy.rb +179 -0
- data/lib/generated/azure_mgmt_sql/models/database_update.rb +464 -0
- data/lib/generated/azure_mgmt_sql/models/{database_metric.rb → database_usage.rb} +13 -11
- data/lib/generated/azure_mgmt_sql/models/{database_metric_list_result.rb → database_usage_list_result.rb} +10 -9
- data/lib/generated/azure_mgmt_sql/models/edition_capability.rb +79 -0
- data/lib/generated/azure_mgmt_sql/models/elastic_pool.rb +15 -14
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb +12 -22
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb +12 -22
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_dtu_capability.rb +143 -0
- data/lib/generated/azure_mgmt_sql/models/{elastic_pool_editions.rb → elastic_pool_edition.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_edition_capability.rb +79 -0
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_per_database_max_dtu_capability.rb +79 -0
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_per_database_min_dtu_capability.rb +59 -0
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_state.rb +1 -1
- data/lib/generated/azure_mgmt_sql/models/elastic_pool_update.rb +152 -0
- data/lib/generated/azure_mgmt_sql/models/encryption_protector.rb +137 -0
- data/lib/generated/azure_mgmt_sql/models/encryption_protector_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/export_request.rb +101 -0
- data/lib/generated/azure_mgmt_sql/models/failover_group.rb +171 -0
- data/lib/generated/azure_mgmt_sql/models/failover_group_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/failover_group_read_only_endpoint.rb +47 -0
- data/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb +58 -0
- data/lib/generated/azure_mgmt_sql/models/failover_group_replication_role.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/{server_firewall_rule.rb → firewall_rule.rb} +6 -5
- data/lib/generated/azure_mgmt_sql/models/{server_firewall_rule_list_result.rb → firewall_rule_list_result.rb} +9 -8
- data/lib/generated/azure_mgmt_sql/models/geo_backup_policy.rb +105 -0
- data/lib/generated/azure_mgmt_sql/models/geo_backup_policy_list_result.rb +53 -0
- data/lib/generated/azure_mgmt_sql/models/geo_backup_policy_state.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/{table_type.rb → identity_type.rb} +4 -5
- data/lib/generated/azure_mgmt_sql/models/import_export_response.rb +158 -0
- data/lib/generated/azure_mgmt_sql/models/import_extension_request.rb +134 -0
- data/lib/generated/azure_mgmt_sql/models/import_request.rb +125 -0
- data/lib/generated/azure_mgmt_sql/models/location_capabilities.rb +80 -0
- data/lib/generated/azure_mgmt_sql/models/max_size_capability.rb +74 -0
- data/lib/generated/azure_mgmt_sql/models/max_size_units.rb +18 -0
- data/lib/generated/azure_mgmt_sql/models/metric.rb +114 -0
- data/lib/generated/azure_mgmt_sql/models/metric_availability.rb +57 -0
- data/lib/generated/azure_mgmt_sql/models/metric_definition.rb +104 -0
- data/lib/generated/azure_mgmt_sql/models/metric_definition_list_result.rb +54 -0
- data/lib/generated/azure_mgmt_sql/models/metric_list_result.rb +53 -0
- data/lib/generated/azure_mgmt_sql/models/metric_name.rb +57 -0
- data/lib/generated/azure_mgmt_sql/models/metric_value.rb +117 -0
- data/lib/generated/azure_mgmt_sql/models/operation.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/operation_display.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/operation_impact.rb +3 -2
- data/lib/generated/azure_mgmt_sql/models/operation_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/partner_info.rb +68 -0
- data/lib/generated/azure_mgmt_sql/models/performance_level_unit.rb +15 -0
- data/lib/generated/azure_mgmt_sql/models/primary_aggregation_type.rb +20 -0
- data/lib/generated/azure_mgmt_sql/models/proxy_resource.rb +59 -0
- data/lib/generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/read_scale.rb +1 -1
- data/lib/generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb +9 -29
- data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_metric.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/recommended_index.rb +13 -33
- data/lib/generated/azure_mgmt_sql/models/{recommended_index_actions.rb → recommended_index_action.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/{recommended_index_states.rb → recommended_index_state.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/{recommended_index_types.rb → recommended_index_type.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/recoverable_database.rb +104 -0
- data/lib/generated/azure_mgmt_sql/models/recoverable_database_list_result.rb +53 -0
- data/lib/generated/azure_mgmt_sql/models/replication_link.rb +3 -2
- data/lib/generated/azure_mgmt_sql/models/replication_link_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/replication_role.rb +1 -1
- data/lib/generated/azure_mgmt_sql/models/replication_state.rb +1 -1
- data/lib/generated/azure_mgmt_sql/models/resource_identity.rb +69 -0
- data/lib/generated/azure_mgmt_sql/models/restorable_dropped_database.rb +159 -0
- data/lib/generated/azure_mgmt_sql/models/restorable_dropped_database_list_result.rb +54 -0
- data/lib/generated/azure_mgmt_sql/models/restore_point.rb +10 -30
- data/lib/generated/azure_mgmt_sql/models/restore_point_list_result.rb +4 -4
- data/lib/generated/azure_mgmt_sql/models/{restore_point_types.rb → restore_point_type.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/sample_name.rb +1 -1
- data/lib/generated/azure_mgmt_sql/models/security_alert_policy_email_account_admins.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/security_alert_policy_state.rb +17 -0
- data/lib/generated/azure_mgmt_sql/models/security_alert_policy_use_server_default.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/server.rb +38 -56
- data/lib/generated/azure_mgmt_sql/models/server_administrator_list_result.rb +54 -0
- data/lib/generated/azure_mgmt_sql/models/server_azure_adadministrator.rb +94 -0
- data/lib/generated/azure_mgmt_sql/models/server_communication_link.rb +103 -0
- data/lib/generated/azure_mgmt_sql/models/server_communication_link_list_result.rb +54 -0
- data/lib/generated/azure_mgmt_sql/models/{schema.rb → server_connection_policy.rb} +33 -38
- data/lib/generated/azure_mgmt_sql/models/server_connection_type.rb +17 -0
- data/lib/generated/azure_mgmt_sql/models/server_key.rb +135 -0
- data/lib/generated/azure_mgmt_sql/models/server_key_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/models/server_key_type.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/server_list_result.rb +48 -4
- data/lib/generated/azure_mgmt_sql/models/server_update.rb +106 -0
- data/lib/generated/azure_mgmt_sql/models/{server_metric.rb → server_usage.rb} +6 -5
- data/lib/generated/azure_mgmt_sql/models/{server_metric_list_result.rb → server_usage_list_result.rb} +9 -9
- data/lib/generated/azure_mgmt_sql/models/server_version_capability.rb +99 -0
- data/lib/generated/azure_mgmt_sql/models/service_objective.rb +3 -2
- data/lib/generated/azure_mgmt_sql/models/service_objective_capability.rb +127 -0
- data/lib/generated/azure_mgmt_sql/models/service_objective_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/service_objective_name.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +3 -2
- data/lib/generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb +8 -3
- data/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb +3 -2
- data/lib/generated/azure_mgmt_sql/models/storage_key_type.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/sub_resource.rb +54 -0
- data/lib/generated/azure_mgmt_sql/models/{column.rb → tracked_resource.rb} +19 -23
- data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +6 -5
- data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +4 -3
- data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb +2 -1
- data/lib/generated/azure_mgmt_sql/models/{transparent_data_encryption_activity_states.rb → transparent_data_encryption_activity_status.rb} +3 -3
- data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_status.rb +16 -0
- data/lib/generated/azure_mgmt_sql/models/unit_definition_type.rb +20 -0
- data/lib/generated/azure_mgmt_sql/models/unit_type.rb +20 -0
- data/lib/generated/azure_mgmt_sql/models/virtual_network_rule.rb +69 -0
- data/lib/generated/azure_mgmt_sql/models/virtual_network_rule_list_result.rb +96 -0
- data/lib/generated/azure_mgmt_sql/module_definition.rb +1 -1
- data/lib/generated/azure_mgmt_sql/operations.rb +109 -0
- data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +21 -22
- data/lib/generated/azure_mgmt_sql/recoverable_databases.rb +229 -0
- data/lib/generated/azure_mgmt_sql/restorable_dropped_databases.rb +229 -0
- data/lib/generated/azure_mgmt_sql/server_azure_adadministrators.rb +575 -0
- data/lib/generated/azure_mgmt_sql/server_communication_links.rb +496 -0
- data/lib/generated/azure_mgmt_sql/server_keys.rb +670 -0
- data/lib/generated/azure_mgmt_sql/servers.rb +1366 -257
- data/lib/generated/azure_mgmt_sql/sql_management_client.rb +44 -85
- data/lib/generated/azure_mgmt_sql/version.rb +2 -2
- data/lib/generated/azure_mgmt_sql/virtual_network_rules.rb +663 -0
- metadata +110 -27
- data/lib/generated/azure_mgmt_sql/models/server_version.rb +0 -16
- data/lib/generated/azure_mgmt_sql/models/table.rb +0 -131
- data/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb +0 -17
- data/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb +0 -54
- data/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb +0 -131
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 1.
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
@@ -32,18 +32,48 @@ module Azure::ARM::SQL
|
|
32
32
|
# is generated and included in each request. Default is true.
|
33
33
|
attr_accessor :generate_client_request_id
|
34
34
|
|
35
|
+
# @return [Databases] databases
|
36
|
+
attr_reader :databases
|
37
|
+
|
35
38
|
# @return [Servers] servers
|
36
39
|
attr_reader :servers
|
37
40
|
|
38
|
-
# @return [
|
39
|
-
attr_reader :
|
41
|
+
# @return [RecoverableDatabases] recoverable_databases
|
42
|
+
attr_reader :recoverable_databases
|
43
|
+
|
44
|
+
# @return [RestorableDroppedDatabases] restorable_dropped_databases
|
45
|
+
attr_reader :restorable_dropped_databases
|
46
|
+
|
47
|
+
# @return [Capabilities] capabilities
|
48
|
+
attr_reader :capabilities
|
49
|
+
|
50
|
+
# @return [FirewallRules] firewall_rules
|
51
|
+
attr_reader :firewall_rules
|
40
52
|
|
41
53
|
# @return [ElasticPools] elastic_pools
|
42
54
|
attr_reader :elastic_pools
|
43
55
|
|
56
|
+
# @return [Operations] operations
|
57
|
+
attr_reader :operations
|
58
|
+
|
59
|
+
# @return [ServerAzureADAdministrators] server_azure_adadministrators
|
60
|
+
attr_reader :server_azure_adadministrators
|
61
|
+
|
62
|
+
# @return [ServerCommunicationLinks] server_communication_links
|
63
|
+
attr_reader :server_communication_links
|
64
|
+
|
44
65
|
# @return [RecommendedElasticPools] recommended_elastic_pools
|
45
66
|
attr_reader :recommended_elastic_pools
|
46
67
|
|
68
|
+
# @return [FailoverGroups] failover_groups
|
69
|
+
attr_reader :failover_groups
|
70
|
+
|
71
|
+
# @return [ServerKeys] server_keys
|
72
|
+
attr_reader :server_keys
|
73
|
+
|
74
|
+
# @return [VirtualNetworkRules] virtual_network_rules
|
75
|
+
attr_reader :virtual_network_rules
|
76
|
+
|
47
77
|
#
|
48
78
|
# Creates initializes a new instance of the SqlManagementClient class.
|
49
79
|
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
@@ -57,10 +87,20 @@ module Azure::ARM::SQL
|
|
57
87
|
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
58
88
|
@credentials = credentials
|
59
89
|
|
60
|
-
@servers = Servers.new(self)
|
61
90
|
@databases = Databases.new(self)
|
91
|
+
@servers = Servers.new(self)
|
92
|
+
@recoverable_databases = RecoverableDatabases.new(self)
|
93
|
+
@restorable_dropped_databases = RestorableDroppedDatabases.new(self)
|
94
|
+
@capabilities = Capabilities.new(self)
|
95
|
+
@firewall_rules = FirewallRules.new(self)
|
62
96
|
@elastic_pools = ElasticPools.new(self)
|
97
|
+
@operations = Operations.new(self)
|
98
|
+
@server_azure_adadministrators = ServerAzureADAdministrators.new(self)
|
99
|
+
@server_communication_links = ServerCommunicationLinks.new(self)
|
63
100
|
@recommended_elastic_pools = RecommendedElasticPools.new(self)
|
101
|
+
@failover_groups = FailoverGroups.new(self)
|
102
|
+
@server_keys = ServerKeys.new(self)
|
103
|
+
@virtual_network_rules = VirtualNetworkRules.new(self)
|
64
104
|
@accept_language = 'en-US'
|
65
105
|
@long_running_operation_retry_timeout = 30
|
66
106
|
@generate_client_request_id = true
|
@@ -122,87 +162,6 @@ module Azure::ARM::SQL
|
|
122
162
|
super(request_url, method, path, options)
|
123
163
|
end
|
124
164
|
|
125
|
-
#
|
126
|
-
# Lists all of the available SQL Rest API operations.
|
127
|
-
#
|
128
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
129
|
-
# will be added to the HTTP request.
|
130
|
-
#
|
131
|
-
# @return [OperationListResult] operation results.
|
132
|
-
#
|
133
|
-
def list_operations(custom_headers = nil)
|
134
|
-
response = list_operations_async(custom_headers).value!
|
135
|
-
response.body unless response.nil?
|
136
|
-
end
|
137
|
-
|
138
|
-
#
|
139
|
-
# Lists all of the available SQL Rest API operations.
|
140
|
-
#
|
141
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
142
|
-
# will be added to the HTTP request.
|
143
|
-
#
|
144
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
145
|
-
#
|
146
|
-
def list_operations_with_http_info(custom_headers = nil)
|
147
|
-
list_operations_async(custom_headers).value!
|
148
|
-
end
|
149
|
-
|
150
|
-
#
|
151
|
-
# Lists all of the available SQL Rest API operations.
|
152
|
-
#
|
153
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
154
|
-
# to the HTTP request.
|
155
|
-
#
|
156
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
157
|
-
#
|
158
|
-
def list_operations_async(custom_headers = nil)
|
159
|
-
api_version = '2014-04-01'
|
160
|
-
|
161
|
-
|
162
|
-
request_headers = {}
|
163
|
-
|
164
|
-
# Set Headers
|
165
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
166
|
-
request_headers['accept-language'] = accept_language unless accept_language.nil?
|
167
|
-
path_template = '/providers/Microsoft.Sql/operations'
|
168
|
-
|
169
|
-
request_url = @base_url || self.base_url
|
170
|
-
|
171
|
-
options = {
|
172
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
173
|
-
query_params: {'api-version' => api_version},
|
174
|
-
headers: request_headers.merge(custom_headers || {}),
|
175
|
-
base_url: request_url
|
176
|
-
}
|
177
|
-
promise = self.make_request_async(:get, path_template, options)
|
178
|
-
|
179
|
-
promise = promise.then do |result|
|
180
|
-
http_response = result.response
|
181
|
-
status_code = http_response.status
|
182
|
-
response_content = http_response.body
|
183
|
-
unless status_code == 200
|
184
|
-
error_model = JSON.load(response_content)
|
185
|
-
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
186
|
-
end
|
187
|
-
|
188
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
189
|
-
# Deserialize Response
|
190
|
-
if status_code == 200
|
191
|
-
begin
|
192
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
193
|
-
result_mapper = OperationListResult.mapper()
|
194
|
-
result.body = self.deserialize(result_mapper, parsed_response, 'result.body')
|
195
|
-
rescue Exception => e
|
196
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
|
-
result
|
201
|
-
end
|
202
|
-
|
203
|
-
promise.execute
|
204
|
-
end
|
205
|
-
|
206
165
|
|
207
166
|
private
|
208
167
|
#
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 1.
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
6
|
module Azure::ARM::SQL
|
7
|
-
VERSION = '0.
|
7
|
+
VERSION = '0.11.0'
|
8
8
|
end
|
@@ -0,0 +1,663 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::SQL
|
7
|
+
#
|
8
|
+
# The Azure SQL Database management API provides a RESTful set of web
|
9
|
+
# services that interact with Azure SQL Database services to manage your
|
10
|
+
# databases. The API enables you to create, retrieve, update, and delete
|
11
|
+
# databases.
|
12
|
+
#
|
13
|
+
class VirtualNetworkRules
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the VirtualNetworkRules class.
|
18
|
+
# @param client service class for accessing basic functionality.
|
19
|
+
#
|
20
|
+
def initialize(client)
|
21
|
+
@client = client
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [SqlManagementClient] reference to the SqlManagementClient
|
25
|
+
attr_reader :client
|
26
|
+
|
27
|
+
#
|
28
|
+
# Gets a virtual network rule.
|
29
|
+
#
|
30
|
+
# @param resource_group_name [String] The name of the resource group that
|
31
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
32
|
+
# Manager API or the portal.
|
33
|
+
# @param server_name [String] The name of the server.
|
34
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
35
|
+
# rule.
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
37
|
+
# will be added to the HTTP request.
|
38
|
+
#
|
39
|
+
# @return [VirtualNetworkRule] operation results.
|
40
|
+
#
|
41
|
+
def get(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
42
|
+
response = get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
|
43
|
+
response.body unless response.nil?
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Gets a virtual network rule.
|
48
|
+
#
|
49
|
+
# @param resource_group_name [String] The name of the resource group that
|
50
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
51
|
+
# Manager API or the portal.
|
52
|
+
# @param server_name [String] The name of the server.
|
53
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
54
|
+
# rule.
|
55
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
56
|
+
# will be added to the HTTP request.
|
57
|
+
#
|
58
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
59
|
+
#
|
60
|
+
def get_with_http_info(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
61
|
+
get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
|
62
|
+
end
|
63
|
+
|
64
|
+
#
|
65
|
+
# Gets a virtual network rule.
|
66
|
+
#
|
67
|
+
# @param resource_group_name [String] The name of the resource group that
|
68
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
69
|
+
# Manager API or the portal.
|
70
|
+
# @param server_name [String] The name of the server.
|
71
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
72
|
+
# rule.
|
73
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
74
|
+
# to the HTTP request.
|
75
|
+
#
|
76
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
77
|
+
#
|
78
|
+
def get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
79
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
80
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
81
|
+
fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
|
82
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
83
|
+
api_version = '2015-05-01-preview'
|
84
|
+
|
85
|
+
|
86
|
+
request_headers = {}
|
87
|
+
|
88
|
+
# Set Headers
|
89
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
90
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
91
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}'
|
92
|
+
|
93
|
+
request_url = @base_url || @client.base_url
|
94
|
+
|
95
|
+
options = {
|
96
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
97
|
+
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'virtualNetworkRuleName' => virtual_network_rule_name,'subscriptionId' => @client.subscription_id},
|
98
|
+
query_params: {'api-version' => api_version},
|
99
|
+
headers: request_headers.merge(custom_headers || {}),
|
100
|
+
base_url: request_url
|
101
|
+
}
|
102
|
+
promise = @client.make_request_async(:get, path_template, options)
|
103
|
+
|
104
|
+
promise = promise.then do |result|
|
105
|
+
http_response = result.response
|
106
|
+
status_code = http_response.status
|
107
|
+
response_content = http_response.body
|
108
|
+
unless status_code == 200
|
109
|
+
error_model = JSON.load(response_content)
|
110
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
111
|
+
end
|
112
|
+
|
113
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
114
|
+
# Deserialize Response
|
115
|
+
if status_code == 200
|
116
|
+
begin
|
117
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
118
|
+
result_mapper = Azure::ARM::SQL::Models::VirtualNetworkRule.mapper()
|
119
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
120
|
+
rescue Exception => e
|
121
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
result
|
126
|
+
end
|
127
|
+
|
128
|
+
promise.execute
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Creates or updates an existing virtual network rule.
|
133
|
+
#
|
134
|
+
# @param resource_group_name [String] The name of the resource group that
|
135
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
136
|
+
# Manager API or the portal.
|
137
|
+
# @param server_name [String] The name of the server.
|
138
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
139
|
+
# rule.
|
140
|
+
# @param parameters [VirtualNetworkRule] The requested virtual Network Rule
|
141
|
+
# Resource state.
|
142
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
143
|
+
# will be added to the HTTP request.
|
144
|
+
#
|
145
|
+
# @return [VirtualNetworkRule] operation results.
|
146
|
+
#
|
147
|
+
def create_or_update(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
|
148
|
+
response = create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers).value!
|
149
|
+
response.body unless response.nil?
|
150
|
+
end
|
151
|
+
|
152
|
+
#
|
153
|
+
# @param resource_group_name [String] The name of the resource group that
|
154
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
155
|
+
# Manager API or the portal.
|
156
|
+
# @param server_name [String] The name of the server.
|
157
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
158
|
+
# rule.
|
159
|
+
# @param parameters [VirtualNetworkRule] The requested virtual Network Rule
|
160
|
+
# Resource state.
|
161
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
162
|
+
# will be added to the HTTP request.
|
163
|
+
#
|
164
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
165
|
+
# response.
|
166
|
+
#
|
167
|
+
def create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
|
168
|
+
# Send request
|
169
|
+
promise = begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers)
|
170
|
+
|
171
|
+
promise = promise.then do |response|
|
172
|
+
# Defining deserialization method.
|
173
|
+
deserialize_method = lambda do |parsed_response|
|
174
|
+
result_mapper = Azure::ARM::SQL::Models::VirtualNetworkRule.mapper()
|
175
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
176
|
+
end
|
177
|
+
|
178
|
+
# Waiting for response.
|
179
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
180
|
+
end
|
181
|
+
|
182
|
+
promise
|
183
|
+
end
|
184
|
+
|
185
|
+
#
|
186
|
+
# Deletes the virtual network rule with the given name.
|
187
|
+
#
|
188
|
+
# @param resource_group_name [String] The name of the resource group that
|
189
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
190
|
+
# Manager API or the portal.
|
191
|
+
# @param server_name [String] The name of the server.
|
192
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
193
|
+
# rule.
|
194
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
195
|
+
# will be added to the HTTP request.
|
196
|
+
#
|
197
|
+
def delete(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
198
|
+
response = delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
|
199
|
+
nil
|
200
|
+
end
|
201
|
+
|
202
|
+
#
|
203
|
+
# @param resource_group_name [String] The name of the resource group that
|
204
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
205
|
+
# Manager API or the portal.
|
206
|
+
# @param server_name [String] The name of the server.
|
207
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
208
|
+
# rule.
|
209
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
210
|
+
# will be added to the HTTP request.
|
211
|
+
#
|
212
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
213
|
+
# response.
|
214
|
+
#
|
215
|
+
def delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
216
|
+
# Send request
|
217
|
+
promise = begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers)
|
218
|
+
|
219
|
+
promise = promise.then do |response|
|
220
|
+
# Defining deserialization method.
|
221
|
+
deserialize_method = lambda do |parsed_response|
|
222
|
+
end
|
223
|
+
|
224
|
+
# Waiting for response.
|
225
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
226
|
+
end
|
227
|
+
|
228
|
+
promise
|
229
|
+
end
|
230
|
+
|
231
|
+
#
|
232
|
+
# Gets a list of virtual network rules in a server.
|
233
|
+
#
|
234
|
+
# @param resource_group_name [String] The name of the resource group that
|
235
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
236
|
+
# Manager API or the portal.
|
237
|
+
# @param server_name [String] The name of the server.
|
238
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
239
|
+
# will be added to the HTTP request.
|
240
|
+
#
|
241
|
+
# @return [Array<VirtualNetworkRule>] operation results.
|
242
|
+
#
|
243
|
+
def list_by_server(resource_group_name, server_name, custom_headers = nil)
|
244
|
+
first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers)
|
245
|
+
first_page.get_all_items
|
246
|
+
end
|
247
|
+
|
248
|
+
#
|
249
|
+
# Gets a list of virtual network rules in a server.
|
250
|
+
#
|
251
|
+
# @param resource_group_name [String] The name of the resource group that
|
252
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
253
|
+
# Manager API or the portal.
|
254
|
+
# @param server_name [String] The name of the server.
|
255
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
256
|
+
# will be added to the HTTP request.
|
257
|
+
#
|
258
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
259
|
+
#
|
260
|
+
def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil)
|
261
|
+
list_by_server_async(resource_group_name, server_name, custom_headers).value!
|
262
|
+
end
|
263
|
+
|
264
|
+
#
|
265
|
+
# Gets a list of virtual network rules in a server.
|
266
|
+
#
|
267
|
+
# @param resource_group_name [String] The name of the resource group that
|
268
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
269
|
+
# Manager API or the portal.
|
270
|
+
# @param server_name [String] The name of the server.
|
271
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
272
|
+
# to the HTTP request.
|
273
|
+
#
|
274
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
275
|
+
#
|
276
|
+
def list_by_server_async(resource_group_name, server_name, custom_headers = nil)
|
277
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
278
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
279
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
280
|
+
api_version = '2015-05-01-preview'
|
281
|
+
|
282
|
+
|
283
|
+
request_headers = {}
|
284
|
+
|
285
|
+
# Set Headers
|
286
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
287
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
288
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules'
|
289
|
+
|
290
|
+
request_url = @base_url || @client.base_url
|
291
|
+
|
292
|
+
options = {
|
293
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
294
|
+
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
|
295
|
+
query_params: {'api-version' => api_version},
|
296
|
+
headers: request_headers.merge(custom_headers || {}),
|
297
|
+
base_url: request_url
|
298
|
+
}
|
299
|
+
promise = @client.make_request_async(:get, path_template, options)
|
300
|
+
|
301
|
+
promise = promise.then do |result|
|
302
|
+
http_response = result.response
|
303
|
+
status_code = http_response.status
|
304
|
+
response_content = http_response.body
|
305
|
+
unless status_code == 200
|
306
|
+
error_model = JSON.load(response_content)
|
307
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
308
|
+
end
|
309
|
+
|
310
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
311
|
+
# Deserialize Response
|
312
|
+
if status_code == 200
|
313
|
+
begin
|
314
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
315
|
+
result_mapper = Azure::ARM::SQL::Models::VirtualNetworkRuleListResult.mapper()
|
316
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
317
|
+
rescue Exception => e
|
318
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
result
|
323
|
+
end
|
324
|
+
|
325
|
+
promise.execute
|
326
|
+
end
|
327
|
+
|
328
|
+
#
|
329
|
+
# Creates or updates an existing virtual network rule.
|
330
|
+
#
|
331
|
+
# @param resource_group_name [String] The name of the resource group that
|
332
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
333
|
+
# Manager API or the portal.
|
334
|
+
# @param server_name [String] The name of the server.
|
335
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
336
|
+
# rule.
|
337
|
+
# @param parameters [VirtualNetworkRule] The requested virtual Network Rule
|
338
|
+
# Resource state.
|
339
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
340
|
+
# will be added to the HTTP request.
|
341
|
+
#
|
342
|
+
# @return [VirtualNetworkRule] operation results.
|
343
|
+
#
|
344
|
+
def begin_create_or_update(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
|
345
|
+
response = begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers).value!
|
346
|
+
response.body unless response.nil?
|
347
|
+
end
|
348
|
+
|
349
|
+
#
|
350
|
+
# Creates or updates an existing virtual network rule.
|
351
|
+
#
|
352
|
+
# @param resource_group_name [String] The name of the resource group that
|
353
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
354
|
+
# Manager API or the portal.
|
355
|
+
# @param server_name [String] The name of the server.
|
356
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
357
|
+
# rule.
|
358
|
+
# @param parameters [VirtualNetworkRule] The requested virtual Network Rule
|
359
|
+
# Resource state.
|
360
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
361
|
+
# will be added to the HTTP request.
|
362
|
+
#
|
363
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
364
|
+
#
|
365
|
+
def begin_create_or_update_with_http_info(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
|
366
|
+
begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers).value!
|
367
|
+
end
|
368
|
+
|
369
|
+
#
|
370
|
+
# Creates or updates an existing virtual network rule.
|
371
|
+
#
|
372
|
+
# @param resource_group_name [String] The name of the resource group that
|
373
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
374
|
+
# Manager API or the portal.
|
375
|
+
# @param server_name [String] The name of the server.
|
376
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
377
|
+
# rule.
|
378
|
+
# @param parameters [VirtualNetworkRule] The requested virtual Network Rule
|
379
|
+
# Resource state.
|
380
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
381
|
+
# to the HTTP request.
|
382
|
+
#
|
383
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
384
|
+
#
|
385
|
+
def begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
|
386
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
387
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
388
|
+
fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
|
389
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
390
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
391
|
+
api_version = '2015-05-01-preview'
|
392
|
+
|
393
|
+
|
394
|
+
request_headers = {}
|
395
|
+
|
396
|
+
# Set Headers
|
397
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
398
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
399
|
+
|
400
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
401
|
+
|
402
|
+
# Serialize Request
|
403
|
+
request_mapper = Azure::ARM::SQL::Models::VirtualNetworkRule.mapper()
|
404
|
+
request_content = @client.serialize(request_mapper, parameters)
|
405
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
406
|
+
|
407
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}'
|
408
|
+
|
409
|
+
request_url = @base_url || @client.base_url
|
410
|
+
|
411
|
+
options = {
|
412
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
413
|
+
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'virtualNetworkRuleName' => virtual_network_rule_name,'subscriptionId' => @client.subscription_id},
|
414
|
+
query_params: {'api-version' => api_version},
|
415
|
+
body: request_content,
|
416
|
+
headers: request_headers.merge(custom_headers || {}),
|
417
|
+
base_url: request_url
|
418
|
+
}
|
419
|
+
promise = @client.make_request_async(:put, path_template, options)
|
420
|
+
|
421
|
+
promise = promise.then do |result|
|
422
|
+
http_response = result.response
|
423
|
+
status_code = http_response.status
|
424
|
+
response_content = http_response.body
|
425
|
+
unless status_code == 200 || status_code == 202 || status_code == 201
|
426
|
+
error_model = JSON.load(response_content)
|
427
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
428
|
+
end
|
429
|
+
|
430
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
431
|
+
# Deserialize Response
|
432
|
+
if status_code == 200
|
433
|
+
begin
|
434
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
435
|
+
result_mapper = Azure::ARM::SQL::Models::VirtualNetworkRule.mapper()
|
436
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
437
|
+
rescue Exception => e
|
438
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
439
|
+
end
|
440
|
+
end
|
441
|
+
# Deserialize Response
|
442
|
+
if status_code == 201
|
443
|
+
begin
|
444
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
445
|
+
result_mapper = Azure::ARM::SQL::Models::VirtualNetworkRule.mapper()
|
446
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
447
|
+
rescue Exception => e
|
448
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
452
|
+
result
|
453
|
+
end
|
454
|
+
|
455
|
+
promise.execute
|
456
|
+
end
|
457
|
+
|
458
|
+
#
|
459
|
+
# Deletes the virtual network rule with the given name.
|
460
|
+
#
|
461
|
+
# @param resource_group_name [String] The name of the resource group that
|
462
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
463
|
+
# Manager API or the portal.
|
464
|
+
# @param server_name [String] The name of the server.
|
465
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
466
|
+
# rule.
|
467
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
468
|
+
# will be added to the HTTP request.
|
469
|
+
#
|
470
|
+
#
|
471
|
+
def begin_delete(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
472
|
+
response = begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
|
473
|
+
nil
|
474
|
+
end
|
475
|
+
|
476
|
+
#
|
477
|
+
# Deletes the virtual network rule with the given name.
|
478
|
+
#
|
479
|
+
# @param resource_group_name [String] The name of the resource group that
|
480
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
481
|
+
# Manager API or the portal.
|
482
|
+
# @param server_name [String] The name of the server.
|
483
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
484
|
+
# rule.
|
485
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
486
|
+
# will be added to the HTTP request.
|
487
|
+
#
|
488
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
489
|
+
#
|
490
|
+
def begin_delete_with_http_info(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
491
|
+
begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
|
492
|
+
end
|
493
|
+
|
494
|
+
#
|
495
|
+
# Deletes the virtual network rule with the given name.
|
496
|
+
#
|
497
|
+
# @param resource_group_name [String] The name of the resource group that
|
498
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
499
|
+
# Manager API or the portal.
|
500
|
+
# @param server_name [String] The name of the server.
|
501
|
+
# @param virtual_network_rule_name [String] The name of the virtual network
|
502
|
+
# rule.
|
503
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
504
|
+
# to the HTTP request.
|
505
|
+
#
|
506
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
507
|
+
#
|
508
|
+
def begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
|
509
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
510
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
511
|
+
fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
|
512
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
513
|
+
api_version = '2015-05-01-preview'
|
514
|
+
|
515
|
+
|
516
|
+
request_headers = {}
|
517
|
+
|
518
|
+
# Set Headers
|
519
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
520
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
521
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}'
|
522
|
+
|
523
|
+
request_url = @base_url || @client.base_url
|
524
|
+
|
525
|
+
options = {
|
526
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
527
|
+
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'virtualNetworkRuleName' => virtual_network_rule_name,'subscriptionId' => @client.subscription_id},
|
528
|
+
query_params: {'api-version' => api_version},
|
529
|
+
headers: request_headers.merge(custom_headers || {}),
|
530
|
+
base_url: request_url
|
531
|
+
}
|
532
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
533
|
+
|
534
|
+
promise = promise.then do |result|
|
535
|
+
http_response = result.response
|
536
|
+
status_code = http_response.status
|
537
|
+
response_content = http_response.body
|
538
|
+
unless status_code == 200 || status_code == 202 || status_code == 204
|
539
|
+
error_model = JSON.load(response_content)
|
540
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
541
|
+
end
|
542
|
+
|
543
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
544
|
+
|
545
|
+
result
|
546
|
+
end
|
547
|
+
|
548
|
+
promise.execute
|
549
|
+
end
|
550
|
+
|
551
|
+
#
|
552
|
+
# Gets a list of virtual network rules in a server.
|
553
|
+
#
|
554
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
555
|
+
# to List operation.
|
556
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
557
|
+
# will be added to the HTTP request.
|
558
|
+
#
|
559
|
+
# @return [VirtualNetworkRuleListResult] operation results.
|
560
|
+
#
|
561
|
+
def list_by_server_next(next_page_link, custom_headers = nil)
|
562
|
+
response = list_by_server_next_async(next_page_link, custom_headers).value!
|
563
|
+
response.body unless response.nil?
|
564
|
+
end
|
565
|
+
|
566
|
+
#
|
567
|
+
# Gets a list of virtual network rules in a server.
|
568
|
+
#
|
569
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
570
|
+
# to List operation.
|
571
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
572
|
+
# will be added to the HTTP request.
|
573
|
+
#
|
574
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
575
|
+
#
|
576
|
+
def list_by_server_next_with_http_info(next_page_link, custom_headers = nil)
|
577
|
+
list_by_server_next_async(next_page_link, custom_headers).value!
|
578
|
+
end
|
579
|
+
|
580
|
+
#
|
581
|
+
# Gets a list of virtual network rules in a server.
|
582
|
+
#
|
583
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
584
|
+
# to List operation.
|
585
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
586
|
+
# to the HTTP request.
|
587
|
+
#
|
588
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
589
|
+
#
|
590
|
+
def list_by_server_next_async(next_page_link, custom_headers = nil)
|
591
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
592
|
+
|
593
|
+
|
594
|
+
request_headers = {}
|
595
|
+
|
596
|
+
# Set Headers
|
597
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
598
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
599
|
+
path_template = '{nextLink}'
|
600
|
+
|
601
|
+
request_url = @base_url || @client.base_url
|
602
|
+
|
603
|
+
options = {
|
604
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
605
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
606
|
+
headers: request_headers.merge(custom_headers || {}),
|
607
|
+
base_url: request_url
|
608
|
+
}
|
609
|
+
promise = @client.make_request_async(:get, path_template, options)
|
610
|
+
|
611
|
+
promise = promise.then do |result|
|
612
|
+
http_response = result.response
|
613
|
+
status_code = http_response.status
|
614
|
+
response_content = http_response.body
|
615
|
+
unless status_code == 200
|
616
|
+
error_model = JSON.load(response_content)
|
617
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
618
|
+
end
|
619
|
+
|
620
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
621
|
+
# Deserialize Response
|
622
|
+
if status_code == 200
|
623
|
+
begin
|
624
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
625
|
+
result_mapper = Azure::ARM::SQL::Models::VirtualNetworkRuleListResult.mapper()
|
626
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
627
|
+
rescue Exception => e
|
628
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
629
|
+
end
|
630
|
+
end
|
631
|
+
|
632
|
+
result
|
633
|
+
end
|
634
|
+
|
635
|
+
promise.execute
|
636
|
+
end
|
637
|
+
|
638
|
+
#
|
639
|
+
# Gets a list of virtual network rules in a server.
|
640
|
+
#
|
641
|
+
# @param resource_group_name [String] The name of the resource group that
|
642
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
643
|
+
# Manager API or the portal.
|
644
|
+
# @param server_name [String] The name of the server.
|
645
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
646
|
+
# will be added to the HTTP request.
|
647
|
+
#
|
648
|
+
# @return [VirtualNetworkRuleListResult] which provide lazy access to pages of
|
649
|
+
# the response.
|
650
|
+
#
|
651
|
+
def list_by_server_as_lazy(resource_group_name, server_name, custom_headers = nil)
|
652
|
+
response = list_by_server_async(resource_group_name, server_name, custom_headers).value!
|
653
|
+
unless response.nil?
|
654
|
+
page = response.body
|
655
|
+
page.next_method = Proc.new do |next_page_link|
|
656
|
+
list_by_server_next_async(next_page_link, custom_headers)
|
657
|
+
end
|
658
|
+
page
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
end
|
663
|
+
end
|