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
@@ -0,0 +1,496 @@
|
|
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 ServerCommunicationLinks
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
#
|
17
|
+
# Creates and initializes a new instance of the ServerCommunicationLinks 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
|
+
# Deletes a server communication link.
|
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 communication_link_name [String] The name of the server communication
|
35
|
+
# link.
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
37
|
+
# will be added to the HTTP request.
|
38
|
+
#
|
39
|
+
#
|
40
|
+
def delete(resource_group_name, server_name, communication_link_name, custom_headers = nil)
|
41
|
+
response = delete_async(resource_group_name, server_name, communication_link_name, custom_headers).value!
|
42
|
+
nil
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Deletes a server communication link.
|
47
|
+
#
|
48
|
+
# @param resource_group_name [String] The name of the resource group that
|
49
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
50
|
+
# Manager API or the portal.
|
51
|
+
# @param server_name [String] The name of the server.
|
52
|
+
# @param communication_link_name [String] The name of the server communication
|
53
|
+
# link.
|
54
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
55
|
+
# will be added to the HTTP request.
|
56
|
+
#
|
57
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
58
|
+
#
|
59
|
+
def delete_with_http_info(resource_group_name, server_name, communication_link_name, custom_headers = nil)
|
60
|
+
delete_async(resource_group_name, server_name, communication_link_name, custom_headers).value!
|
61
|
+
end
|
62
|
+
|
63
|
+
#
|
64
|
+
# Deletes a server communication link.
|
65
|
+
#
|
66
|
+
# @param resource_group_name [String] The name of the resource group that
|
67
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
68
|
+
# Manager API or the portal.
|
69
|
+
# @param server_name [String] The name of the server.
|
70
|
+
# @param communication_link_name [String] The name of the server communication
|
71
|
+
# link.
|
72
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
73
|
+
# to the HTTP request.
|
74
|
+
#
|
75
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
76
|
+
#
|
77
|
+
def delete_async(resource_group_name, server_name, communication_link_name, custom_headers = nil)
|
78
|
+
api_version = '2014-04-01'
|
79
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
80
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
81
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
82
|
+
fail ArgumentError, 'communication_link_name is nil' if communication_link_name.nil?
|
83
|
+
|
84
|
+
|
85
|
+
request_headers = {}
|
86
|
+
|
87
|
+
# Set Headers
|
88
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
89
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
90
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'
|
91
|
+
|
92
|
+
request_url = @base_url || @client.base_url
|
93
|
+
|
94
|
+
options = {
|
95
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
96
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'communicationLinkName' => communication_link_name},
|
97
|
+
query_params: {'api-version' => api_version},
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
100
|
+
}
|
101
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
102
|
+
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
105
|
+
status_code = http_response.status
|
106
|
+
response_content = http_response.body
|
107
|
+
unless status_code == 200
|
108
|
+
error_model = JSON.load(response_content)
|
109
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
110
|
+
end
|
111
|
+
|
112
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
113
|
+
|
114
|
+
result
|
115
|
+
end
|
116
|
+
|
117
|
+
promise.execute
|
118
|
+
end
|
119
|
+
|
120
|
+
#
|
121
|
+
# Returns a server communication link.
|
122
|
+
#
|
123
|
+
# @param resource_group_name [String] The name of the resource group that
|
124
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
125
|
+
# Manager API or the portal.
|
126
|
+
# @param server_name [String] The name of the server.
|
127
|
+
# @param communication_link_name [String] The name of the server communication
|
128
|
+
# link.
|
129
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
130
|
+
# will be added to the HTTP request.
|
131
|
+
#
|
132
|
+
# @return [ServerCommunicationLink] operation results.
|
133
|
+
#
|
134
|
+
def get(resource_group_name, server_name, communication_link_name, custom_headers = nil)
|
135
|
+
response = get_async(resource_group_name, server_name, communication_link_name, custom_headers).value!
|
136
|
+
response.body unless response.nil?
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# Returns a server communication link.
|
141
|
+
#
|
142
|
+
# @param resource_group_name [String] The name of the resource group that
|
143
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
144
|
+
# Manager API or the portal.
|
145
|
+
# @param server_name [String] The name of the server.
|
146
|
+
# @param communication_link_name [String] The name of the server communication
|
147
|
+
# link.
|
148
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
149
|
+
# will be added to the HTTP request.
|
150
|
+
#
|
151
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
152
|
+
#
|
153
|
+
def get_with_http_info(resource_group_name, server_name, communication_link_name, custom_headers = nil)
|
154
|
+
get_async(resource_group_name, server_name, communication_link_name, custom_headers).value!
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
# Returns a server communication link.
|
159
|
+
#
|
160
|
+
# @param resource_group_name [String] The name of the resource group that
|
161
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
162
|
+
# Manager API or the portal.
|
163
|
+
# @param server_name [String] The name of the server.
|
164
|
+
# @param communication_link_name [String] The name of the server communication
|
165
|
+
# link.
|
166
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
167
|
+
# to the HTTP request.
|
168
|
+
#
|
169
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
170
|
+
#
|
171
|
+
def get_async(resource_group_name, server_name, communication_link_name, custom_headers = nil)
|
172
|
+
api_version = '2014-04-01'
|
173
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
174
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
175
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
176
|
+
fail ArgumentError, 'communication_link_name is nil' if communication_link_name.nil?
|
177
|
+
|
178
|
+
|
179
|
+
request_headers = {}
|
180
|
+
|
181
|
+
# Set Headers
|
182
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
183
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
184
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'
|
185
|
+
|
186
|
+
request_url = @base_url || @client.base_url
|
187
|
+
|
188
|
+
options = {
|
189
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
190
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'communicationLinkName' => communication_link_name},
|
191
|
+
query_params: {'api-version' => api_version},
|
192
|
+
headers: request_headers.merge(custom_headers || {}),
|
193
|
+
base_url: request_url
|
194
|
+
}
|
195
|
+
promise = @client.make_request_async(:get, path_template, options)
|
196
|
+
|
197
|
+
promise = promise.then do |result|
|
198
|
+
http_response = result.response
|
199
|
+
status_code = http_response.status
|
200
|
+
response_content = http_response.body
|
201
|
+
unless status_code == 200
|
202
|
+
error_model = JSON.load(response_content)
|
203
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
204
|
+
end
|
205
|
+
|
206
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
207
|
+
# Deserialize Response
|
208
|
+
if status_code == 200
|
209
|
+
begin
|
210
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
211
|
+
result_mapper = Azure::ARM::SQL::Models::ServerCommunicationLink.mapper()
|
212
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
213
|
+
rescue Exception => e
|
214
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
result
|
219
|
+
end
|
220
|
+
|
221
|
+
promise.execute
|
222
|
+
end
|
223
|
+
|
224
|
+
#
|
225
|
+
# Creates a server communication link.
|
226
|
+
#
|
227
|
+
# @param resource_group_name [String] The name of the resource group that
|
228
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
229
|
+
# Manager API or the portal.
|
230
|
+
# @param server_name [String] The name of the server.
|
231
|
+
# @param communication_link_name [String] The name of the server communication
|
232
|
+
# link.
|
233
|
+
# @param parameters [ServerCommunicationLink] The required parameters for
|
234
|
+
# creating a server communication link.
|
235
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
236
|
+
# will be added to the HTTP request.
|
237
|
+
#
|
238
|
+
# @return [ServerCommunicationLink] operation results.
|
239
|
+
#
|
240
|
+
def create_or_update(resource_group_name, server_name, communication_link_name, parameters, custom_headers = nil)
|
241
|
+
response = create_or_update_async(resource_group_name, server_name, communication_link_name, parameters, custom_headers).value!
|
242
|
+
response.body unless response.nil?
|
243
|
+
end
|
244
|
+
|
245
|
+
#
|
246
|
+
# @param resource_group_name [String] The name of the resource group that
|
247
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
248
|
+
# Manager API or the portal.
|
249
|
+
# @param server_name [String] The name of the server.
|
250
|
+
# @param communication_link_name [String] The name of the server communication
|
251
|
+
# link.
|
252
|
+
# @param parameters [ServerCommunicationLink] The required parameters for
|
253
|
+
# creating a server communication link.
|
254
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
255
|
+
# will be added to the HTTP request.
|
256
|
+
#
|
257
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
258
|
+
# response.
|
259
|
+
#
|
260
|
+
def create_or_update_async(resource_group_name, server_name, communication_link_name, parameters, custom_headers = nil)
|
261
|
+
# Send request
|
262
|
+
promise = begin_create_or_update_async(resource_group_name, server_name, communication_link_name, parameters, custom_headers)
|
263
|
+
|
264
|
+
promise = promise.then do |response|
|
265
|
+
# Defining deserialization method.
|
266
|
+
deserialize_method = lambda do |parsed_response|
|
267
|
+
result_mapper = Azure::ARM::SQL::Models::ServerCommunicationLink.mapper()
|
268
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
269
|
+
end
|
270
|
+
|
271
|
+
# Waiting for response.
|
272
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
273
|
+
end
|
274
|
+
|
275
|
+
promise
|
276
|
+
end
|
277
|
+
|
278
|
+
#
|
279
|
+
# Gets a list of server communication links.
|
280
|
+
#
|
281
|
+
# @param resource_group_name [String] The name of the resource group that
|
282
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
283
|
+
# Manager API or the portal.
|
284
|
+
# @param server_name [String] The name of the server.
|
285
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
286
|
+
# will be added to the HTTP request.
|
287
|
+
#
|
288
|
+
# @return [ServerCommunicationLinkListResult] operation results.
|
289
|
+
#
|
290
|
+
def list_by_server(resource_group_name, server_name, custom_headers = nil)
|
291
|
+
response = list_by_server_async(resource_group_name, server_name, custom_headers).value!
|
292
|
+
response.body unless response.nil?
|
293
|
+
end
|
294
|
+
|
295
|
+
#
|
296
|
+
# Gets a list of server communication links.
|
297
|
+
#
|
298
|
+
# @param resource_group_name [String] The name of the resource group that
|
299
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
300
|
+
# Manager API or the portal.
|
301
|
+
# @param server_name [String] The name of the server.
|
302
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
303
|
+
# will be added to the HTTP request.
|
304
|
+
#
|
305
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
306
|
+
#
|
307
|
+
def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil)
|
308
|
+
list_by_server_async(resource_group_name, server_name, custom_headers).value!
|
309
|
+
end
|
310
|
+
|
311
|
+
#
|
312
|
+
# Gets a list of server communication links.
|
313
|
+
#
|
314
|
+
# @param resource_group_name [String] The name of the resource group that
|
315
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
316
|
+
# Manager API or the portal.
|
317
|
+
# @param server_name [String] The name of the server.
|
318
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
319
|
+
# to the HTTP request.
|
320
|
+
#
|
321
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
322
|
+
#
|
323
|
+
def list_by_server_async(resource_group_name, server_name, custom_headers = nil)
|
324
|
+
api_version = '2014-04-01'
|
325
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
326
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
327
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
328
|
+
|
329
|
+
|
330
|
+
request_headers = {}
|
331
|
+
|
332
|
+
# Set Headers
|
333
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
334
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
335
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks'
|
336
|
+
|
337
|
+
request_url = @base_url || @client.base_url
|
338
|
+
|
339
|
+
options = {
|
340
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
341
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
|
342
|
+
query_params: {'api-version' => api_version},
|
343
|
+
headers: request_headers.merge(custom_headers || {}),
|
344
|
+
base_url: request_url
|
345
|
+
}
|
346
|
+
promise = @client.make_request_async(:get, path_template, options)
|
347
|
+
|
348
|
+
promise = promise.then do |result|
|
349
|
+
http_response = result.response
|
350
|
+
status_code = http_response.status
|
351
|
+
response_content = http_response.body
|
352
|
+
unless status_code == 200
|
353
|
+
error_model = JSON.load(response_content)
|
354
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
355
|
+
end
|
356
|
+
|
357
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
358
|
+
# Deserialize Response
|
359
|
+
if status_code == 200
|
360
|
+
begin
|
361
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
362
|
+
result_mapper = Azure::ARM::SQL::Models::ServerCommunicationLinkListResult.mapper()
|
363
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
364
|
+
rescue Exception => e
|
365
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
result
|
370
|
+
end
|
371
|
+
|
372
|
+
promise.execute
|
373
|
+
end
|
374
|
+
|
375
|
+
#
|
376
|
+
# Creates a server communication link.
|
377
|
+
#
|
378
|
+
# @param resource_group_name [String] The name of the resource group that
|
379
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
380
|
+
# Manager API or the portal.
|
381
|
+
# @param server_name [String] The name of the server.
|
382
|
+
# @param communication_link_name [String] The name of the server communication
|
383
|
+
# link.
|
384
|
+
# @param parameters [ServerCommunicationLink] The required parameters for
|
385
|
+
# creating a server communication link.
|
386
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
387
|
+
# will be added to the HTTP request.
|
388
|
+
#
|
389
|
+
# @return [ServerCommunicationLink] operation results.
|
390
|
+
#
|
391
|
+
def begin_create_or_update(resource_group_name, server_name, communication_link_name, parameters, custom_headers = nil)
|
392
|
+
response = begin_create_or_update_async(resource_group_name, server_name, communication_link_name, parameters, custom_headers).value!
|
393
|
+
response.body unless response.nil?
|
394
|
+
end
|
395
|
+
|
396
|
+
#
|
397
|
+
# Creates a server communication link.
|
398
|
+
#
|
399
|
+
# @param resource_group_name [String] The name of the resource group that
|
400
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
401
|
+
# Manager API or the portal.
|
402
|
+
# @param server_name [String] The name of the server.
|
403
|
+
# @param communication_link_name [String] The name of the server communication
|
404
|
+
# link.
|
405
|
+
# @param parameters [ServerCommunicationLink] The required parameters for
|
406
|
+
# creating a server communication link.
|
407
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
408
|
+
# will be added to the HTTP request.
|
409
|
+
#
|
410
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
411
|
+
#
|
412
|
+
def begin_create_or_update_with_http_info(resource_group_name, server_name, communication_link_name, parameters, custom_headers = nil)
|
413
|
+
begin_create_or_update_async(resource_group_name, server_name, communication_link_name, parameters, custom_headers).value!
|
414
|
+
end
|
415
|
+
|
416
|
+
#
|
417
|
+
# Creates a server communication link.
|
418
|
+
#
|
419
|
+
# @param resource_group_name [String] The name of the resource group that
|
420
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
421
|
+
# Manager API or the portal.
|
422
|
+
# @param server_name [String] The name of the server.
|
423
|
+
# @param communication_link_name [String] The name of the server communication
|
424
|
+
# link.
|
425
|
+
# @param parameters [ServerCommunicationLink] The required parameters for
|
426
|
+
# creating a server communication link.
|
427
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
428
|
+
# to the HTTP request.
|
429
|
+
#
|
430
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
431
|
+
#
|
432
|
+
def begin_create_or_update_async(resource_group_name, server_name, communication_link_name, parameters, custom_headers = nil)
|
433
|
+
api_version = '2014-04-01'
|
434
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
435
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
436
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
437
|
+
fail ArgumentError, 'communication_link_name is nil' if communication_link_name.nil?
|
438
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
439
|
+
|
440
|
+
|
441
|
+
request_headers = {}
|
442
|
+
|
443
|
+
# Set Headers
|
444
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
445
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
446
|
+
|
447
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
448
|
+
|
449
|
+
# Serialize Request
|
450
|
+
request_mapper = Azure::ARM::SQL::Models::ServerCommunicationLink.mapper()
|
451
|
+
request_content = @client.serialize(request_mapper, parameters)
|
452
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
453
|
+
|
454
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'
|
455
|
+
|
456
|
+
request_url = @base_url || @client.base_url
|
457
|
+
|
458
|
+
options = {
|
459
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
460
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'communicationLinkName' => communication_link_name},
|
461
|
+
query_params: {'api-version' => api_version},
|
462
|
+
body: request_content,
|
463
|
+
headers: request_headers.merge(custom_headers || {}),
|
464
|
+
base_url: request_url
|
465
|
+
}
|
466
|
+
promise = @client.make_request_async(:put, path_template, options)
|
467
|
+
|
468
|
+
promise = promise.then do |result|
|
469
|
+
http_response = result.response
|
470
|
+
status_code = http_response.status
|
471
|
+
response_content = http_response.body
|
472
|
+
unless status_code == 201 || status_code == 202
|
473
|
+
error_model = JSON.load(response_content)
|
474
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
475
|
+
end
|
476
|
+
|
477
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
478
|
+
# Deserialize Response
|
479
|
+
if status_code == 201
|
480
|
+
begin
|
481
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
482
|
+
result_mapper = Azure::ARM::SQL::Models::ServerCommunicationLink.mapper()
|
483
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
484
|
+
rescue Exception => e
|
485
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
486
|
+
end
|
487
|
+
end
|
488
|
+
|
489
|
+
result
|
490
|
+
end
|
491
|
+
|
492
|
+
promise.execute
|
493
|
+
end
|
494
|
+
|
495
|
+
end
|
496
|
+
end
|