azure_mgmt_operations_management 0.17.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 +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management.rb +48 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/management_associations.rb +447 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/management_configurations.rb +447 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/arm_template_parameter.rb +57 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/code_message_error.rb +47 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/code_message_error_error.rb +57 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association.rb +96 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association_properties.rb +48 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association_properties_list.rb +56 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration.rb +96 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration_properties.rb +104 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration_properties_list.rb +56 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation.rb +59 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation_display.rb +68 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation_list_result.rb +56 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution.rb +127 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_patch.rb +54 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_plan.rb +86 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_properties.rb +102 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_properties_list.rb +56 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/module_definition.rb +9 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/operations.rb +109 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/operations_management_client.rb +154 -0
- data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/solutions.rb +803 -0
- data/lib/azure_mgmt_operations_management.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/modules/operationsmanagement_profile_module.rb +135 -0
- data/lib/profiles/latest/operationsmanagement_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/operationsmanagement_module_definition.rb +8 -0
- data/lib/version.rb +7 -0
- metadata +148 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e32d3ae47daf88273ce4d717568cf4b89b57c7f0b19b81981ded43685fdc9431
|
4
|
+
data.tar.gz: 01af523df4a03e220289d1e0d426b9c46dfa5c98c37b6960f1510e8134d73ec6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b82f8cdcffbdf19cfc9f55e3f6e2d5d3a81756a819a257b9dee79d86c80e93da989c8e8cef45a1f215e451820be05a926266c83804a09de467e2524eb6523b0f
|
7
|
+
data.tar.gz: 5a8339a7df4db24e19ce2d608cf07aa78eb713726ca0fb233c53bbb119c1fb9142d9bd4d9e7a5bd8c8b411ad7d1baf4ac44dbbc4de6298cdae303f8a89f63e79
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '2015-11-01-preview/generated/azure_mgmt_operations_management/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::OperationsManagement::Mgmt::V2015_11_01_preview
|
23
|
+
autoload :Solutions, '2015-11-01-preview/generated/azure_mgmt_operations_management/solutions.rb'
|
24
|
+
autoload :ManagementAssociations, '2015-11-01-preview/generated/azure_mgmt_operations_management/management_associations.rb'
|
25
|
+
autoload :ManagementConfigurations, '2015-11-01-preview/generated/azure_mgmt_operations_management/management_configurations.rb'
|
26
|
+
autoload :Operations, '2015-11-01-preview/generated/azure_mgmt_operations_management/operations.rb'
|
27
|
+
autoload :OperationsManagementClient, '2015-11-01-preview/generated/azure_mgmt_operations_management/operations_management_client.rb'
|
28
|
+
|
29
|
+
module Models
|
30
|
+
autoload :Solution, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution.rb'
|
31
|
+
autoload :SolutionPropertiesList, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_properties_list.rb'
|
32
|
+
autoload :Operation, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation.rb'
|
33
|
+
autoload :ManagementAssociation, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association.rb'
|
34
|
+
autoload :SolutionProperties, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_properties.rb'
|
35
|
+
autoload :ManagementAssociationPropertiesList, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association_properties_list.rb'
|
36
|
+
autoload :ArmTemplateParameter, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/arm_template_parameter.rb'
|
37
|
+
autoload :ManagementConfiguration, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration.rb'
|
38
|
+
autoload :SolutionPlan, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_plan.rb'
|
39
|
+
autoload :ManagementConfigurationPropertiesList, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration_properties_list.rb'
|
40
|
+
autoload :OperationListResult, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation_list_result.rb'
|
41
|
+
autoload :SolutionPatch, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/solution_patch.rb'
|
42
|
+
autoload :ManagementConfigurationProperties, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_configuration_properties.rb'
|
43
|
+
autoload :CodeMessageErrorError, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/code_message_error_error.rb'
|
44
|
+
autoload :ManagementAssociationProperties, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/management_association_properties.rb'
|
45
|
+
autoload :CodeMessageError, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/code_message_error.rb'
|
46
|
+
autoload :OperationDisplay, '2015-11-01-preview/generated/azure_mgmt_operations_management/models/operation_display.rb'
|
47
|
+
end
|
48
|
+
end
|
data/lib/2015-11-01-preview/generated/azure_mgmt_operations_management/management_associations.rb
ADDED
@@ -0,0 +1,447 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::OperationsManagement::Mgmt::V2015_11_01_preview
|
7
|
+
#
|
8
|
+
# Operations Management Client
|
9
|
+
#
|
10
|
+
class ManagementAssociations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ManagementAssociations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [OperationsManagementClient] reference to the OperationsManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Retrieves the ManagementAssociations list for the subscription
|
26
|
+
#
|
27
|
+
# Retrieves the ManagementAssociations list.
|
28
|
+
#
|
29
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
30
|
+
# will be added to the HTTP request.
|
31
|
+
#
|
32
|
+
# @return [ManagementAssociationPropertiesList] operation results.
|
33
|
+
#
|
34
|
+
def list_by_subscription(custom_headers:nil)
|
35
|
+
response = list_by_subscription_async(custom_headers:custom_headers).value!
|
36
|
+
response.body unless response.nil?
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Retrieves the ManagementAssociations list for the subscription
|
41
|
+
#
|
42
|
+
# Retrieves the ManagementAssociations list.
|
43
|
+
#
|
44
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
|
+
# will be added to the HTTP request.
|
46
|
+
#
|
47
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
|
+
#
|
49
|
+
def list_by_subscription_with_http_info(custom_headers:nil)
|
50
|
+
list_by_subscription_async(custom_headers:custom_headers).value!
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Retrieves the ManagementAssociations list for the subscription
|
55
|
+
#
|
56
|
+
# Retrieves the ManagementAssociations list.
|
57
|
+
#
|
58
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
59
|
+
# to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
62
|
+
#
|
63
|
+
def list_by_subscription_async(custom_headers:nil)
|
64
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
65
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
66
|
+
|
67
|
+
|
68
|
+
request_headers = {}
|
69
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
70
|
+
|
71
|
+
# Set Headers
|
72
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
73
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
74
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.OperationsManagement/ManagementAssociations'
|
75
|
+
|
76
|
+
request_url = @base_url || @client.base_url
|
77
|
+
|
78
|
+
options = {
|
79
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
80
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
81
|
+
query_params: {'api-version' => @client.api_version},
|
82
|
+
headers: request_headers.merge(custom_headers || {}),
|
83
|
+
base_url: request_url
|
84
|
+
}
|
85
|
+
promise = @client.make_request_async(:get, path_template, options)
|
86
|
+
|
87
|
+
promise = promise.then do |result|
|
88
|
+
http_response = result.response
|
89
|
+
status_code = http_response.status
|
90
|
+
response_content = http_response.body
|
91
|
+
unless status_code == 200
|
92
|
+
error_model = JSON.load(response_content)
|
93
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
94
|
+
end
|
95
|
+
|
96
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
97
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
98
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
99
|
+
# Deserialize Response
|
100
|
+
if status_code == 200
|
101
|
+
begin
|
102
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
103
|
+
result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::ManagementAssociationPropertiesList.mapper()
|
104
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
105
|
+
rescue Exception => e
|
106
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
result
|
111
|
+
end
|
112
|
+
|
113
|
+
promise.execute
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Create/Update ManagementAssociation.
|
118
|
+
#
|
119
|
+
# Creates or updates the ManagementAssociation.
|
120
|
+
#
|
121
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
122
|
+
# The name is case insensitive.
|
123
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
124
|
+
# @param parameters [ManagementAssociation] The parameters required to create
|
125
|
+
# ManagementAssociation extension.
|
126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
127
|
+
# will be added to the HTTP request.
|
128
|
+
#
|
129
|
+
# @return [ManagementAssociation] operation results.
|
130
|
+
#
|
131
|
+
def create_or_update(resource_group_name, management_association_name, parameters, custom_headers:nil)
|
132
|
+
response = create_or_update_async(resource_group_name, management_association_name, parameters, custom_headers:custom_headers).value!
|
133
|
+
response.body unless response.nil?
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# Create/Update ManagementAssociation.
|
138
|
+
#
|
139
|
+
# Creates or updates the ManagementAssociation.
|
140
|
+
#
|
141
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
142
|
+
# The name is case insensitive.
|
143
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
144
|
+
# @param parameters [ManagementAssociation] The parameters required to create
|
145
|
+
# ManagementAssociation extension.
|
146
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
147
|
+
# will be added to the HTTP request.
|
148
|
+
#
|
149
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
150
|
+
#
|
151
|
+
def create_or_update_with_http_info(resource_group_name, management_association_name, parameters, custom_headers:nil)
|
152
|
+
create_or_update_async(resource_group_name, management_association_name, parameters, custom_headers:custom_headers).value!
|
153
|
+
end
|
154
|
+
|
155
|
+
#
|
156
|
+
# Create/Update ManagementAssociation.
|
157
|
+
#
|
158
|
+
# Creates or updates the ManagementAssociation.
|
159
|
+
#
|
160
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
161
|
+
# The name is case insensitive.
|
162
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
163
|
+
# @param parameters [ManagementAssociation] The parameters required to create
|
164
|
+
# ManagementAssociation extension.
|
165
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
166
|
+
# to the HTTP request.
|
167
|
+
#
|
168
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
169
|
+
#
|
170
|
+
def create_or_update_async(resource_group_name, management_association_name, parameters, custom_headers:nil)
|
171
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
172
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
173
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
174
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
175
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
176
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
177
|
+
fail ArgumentError, '@client.provider_name is nil' if @client.provider_name.nil?
|
178
|
+
fail ArgumentError, '@client.resource_type is nil' if @client.resource_type.nil?
|
179
|
+
fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
|
180
|
+
fail ArgumentError, 'management_association_name is nil' if management_association_name.nil?
|
181
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
182
|
+
|
183
|
+
|
184
|
+
request_headers = {}
|
185
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
186
|
+
|
187
|
+
# Set Headers
|
188
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
189
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
190
|
+
|
191
|
+
# Serialize Request
|
192
|
+
request_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::ManagementAssociation.mapper()
|
193
|
+
request_content = @client.serialize(request_mapper, parameters)
|
194
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
195
|
+
|
196
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'
|
197
|
+
|
198
|
+
request_url = @base_url || @client.base_url
|
199
|
+
|
200
|
+
options = {
|
201
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
202
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => @client.provider_name,'resourceType' => @client.resource_type,'resourceName' => @client.resource_name,'managementAssociationName' => management_association_name},
|
203
|
+
query_params: {'api-version' => @client.api_version},
|
204
|
+
body: request_content,
|
205
|
+
headers: request_headers.merge(custom_headers || {}),
|
206
|
+
base_url: request_url
|
207
|
+
}
|
208
|
+
promise = @client.make_request_async(:put, path_template, options)
|
209
|
+
|
210
|
+
promise = promise.then do |result|
|
211
|
+
http_response = result.response
|
212
|
+
status_code = http_response.status
|
213
|
+
response_content = http_response.body
|
214
|
+
unless status_code == 200
|
215
|
+
error_model = JSON.load(response_content)
|
216
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
217
|
+
end
|
218
|
+
|
219
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
220
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
221
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
222
|
+
# Deserialize Response
|
223
|
+
if status_code == 200
|
224
|
+
begin
|
225
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
226
|
+
result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::ManagementAssociation.mapper()
|
227
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
228
|
+
rescue Exception => e
|
229
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
result
|
234
|
+
end
|
235
|
+
|
236
|
+
promise.execute
|
237
|
+
end
|
238
|
+
|
239
|
+
#
|
240
|
+
# Deletes the ManagementAssociation
|
241
|
+
#
|
242
|
+
# Deletes the ManagementAssociation in the subscription.
|
243
|
+
#
|
244
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
245
|
+
# The name is case insensitive.
|
246
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
247
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
248
|
+
# will be added to the HTTP request.
|
249
|
+
#
|
250
|
+
#
|
251
|
+
def delete(resource_group_name, management_association_name, custom_headers:nil)
|
252
|
+
response = delete_async(resource_group_name, management_association_name, custom_headers:custom_headers).value!
|
253
|
+
nil
|
254
|
+
end
|
255
|
+
|
256
|
+
#
|
257
|
+
# Deletes the ManagementAssociation
|
258
|
+
#
|
259
|
+
# Deletes the ManagementAssociation in the subscription.
|
260
|
+
#
|
261
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
262
|
+
# The name is case insensitive.
|
263
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
264
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
265
|
+
# will be added to the HTTP request.
|
266
|
+
#
|
267
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
268
|
+
#
|
269
|
+
def delete_with_http_info(resource_group_name, management_association_name, custom_headers:nil)
|
270
|
+
delete_async(resource_group_name, management_association_name, custom_headers:custom_headers).value!
|
271
|
+
end
|
272
|
+
|
273
|
+
#
|
274
|
+
# Deletes the ManagementAssociation
|
275
|
+
#
|
276
|
+
# Deletes the ManagementAssociation in the subscription.
|
277
|
+
#
|
278
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
279
|
+
# The name is case insensitive.
|
280
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
281
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
282
|
+
# to the HTTP request.
|
283
|
+
#
|
284
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
285
|
+
#
|
286
|
+
def delete_async(resource_group_name, management_association_name, custom_headers:nil)
|
287
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
288
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
289
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
290
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
291
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
292
|
+
fail ArgumentError, '@client.provider_name is nil' if @client.provider_name.nil?
|
293
|
+
fail ArgumentError, '@client.resource_type is nil' if @client.resource_type.nil?
|
294
|
+
fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
|
295
|
+
fail ArgumentError, 'management_association_name is nil' if management_association_name.nil?
|
296
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
297
|
+
|
298
|
+
|
299
|
+
request_headers = {}
|
300
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
301
|
+
|
302
|
+
# Set Headers
|
303
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
304
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
305
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'
|
306
|
+
|
307
|
+
request_url = @base_url || @client.base_url
|
308
|
+
|
309
|
+
options = {
|
310
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
311
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => @client.provider_name,'resourceType' => @client.resource_type,'resourceName' => @client.resource_name,'managementAssociationName' => management_association_name},
|
312
|
+
query_params: {'api-version' => @client.api_version},
|
313
|
+
headers: request_headers.merge(custom_headers || {}),
|
314
|
+
base_url: request_url
|
315
|
+
}
|
316
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
317
|
+
|
318
|
+
promise = promise.then do |result|
|
319
|
+
http_response = result.response
|
320
|
+
status_code = http_response.status
|
321
|
+
response_content = http_response.body
|
322
|
+
unless status_code == 200
|
323
|
+
error_model = JSON.load(response_content)
|
324
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
325
|
+
end
|
326
|
+
|
327
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
328
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
329
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
330
|
+
|
331
|
+
result
|
332
|
+
end
|
333
|
+
|
334
|
+
promise.execute
|
335
|
+
end
|
336
|
+
|
337
|
+
#
|
338
|
+
# Retrieve ManagementAssociation.
|
339
|
+
#
|
340
|
+
# Retrieves the user ManagementAssociation.
|
341
|
+
#
|
342
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
343
|
+
# The name is case insensitive.
|
344
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
345
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
346
|
+
# will be added to the HTTP request.
|
347
|
+
#
|
348
|
+
# @return [ManagementAssociation] operation results.
|
349
|
+
#
|
350
|
+
def get(resource_group_name, management_association_name, custom_headers:nil)
|
351
|
+
response = get_async(resource_group_name, management_association_name, custom_headers:custom_headers).value!
|
352
|
+
response.body unless response.nil?
|
353
|
+
end
|
354
|
+
|
355
|
+
#
|
356
|
+
# Retrieve ManagementAssociation.
|
357
|
+
#
|
358
|
+
# Retrieves the user ManagementAssociation.
|
359
|
+
#
|
360
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
361
|
+
# The name is case insensitive.
|
362
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
363
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
364
|
+
# will be added to the HTTP request.
|
365
|
+
#
|
366
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
367
|
+
#
|
368
|
+
def get_with_http_info(resource_group_name, management_association_name, custom_headers:nil)
|
369
|
+
get_async(resource_group_name, management_association_name, custom_headers:custom_headers).value!
|
370
|
+
end
|
371
|
+
|
372
|
+
#
|
373
|
+
# Retrieve ManagementAssociation.
|
374
|
+
#
|
375
|
+
# Retrieves the user ManagementAssociation.
|
376
|
+
#
|
377
|
+
# @param resource_group_name [String] The name of the resource group to get.
|
378
|
+
# The name is case insensitive.
|
379
|
+
# @param management_association_name [String] User ManagementAssociation Name.
|
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 get_async(resource_group_name, management_association_name, custom_headers:nil)
|
386
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
387
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
388
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
389
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
390
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
391
|
+
fail ArgumentError, '@client.provider_name is nil' if @client.provider_name.nil?
|
392
|
+
fail ArgumentError, '@client.resource_type is nil' if @client.resource_type.nil?
|
393
|
+
fail ArgumentError, '@client.resource_name is nil' if @client.resource_name.nil?
|
394
|
+
fail ArgumentError, 'management_association_name is nil' if management_association_name.nil?
|
395
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
396
|
+
|
397
|
+
|
398
|
+
request_headers = {}
|
399
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
400
|
+
|
401
|
+
# Set Headers
|
402
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
403
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
404
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.OperationsManagement/ManagementAssociations/{managementAssociationName}'
|
405
|
+
|
406
|
+
request_url = @base_url || @client.base_url
|
407
|
+
|
408
|
+
options = {
|
409
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
410
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'providerName' => @client.provider_name,'resourceType' => @client.resource_type,'resourceName' => @client.resource_name,'managementAssociationName' => management_association_name},
|
411
|
+
query_params: {'api-version' => @client.api_version},
|
412
|
+
headers: request_headers.merge(custom_headers || {}),
|
413
|
+
base_url: request_url
|
414
|
+
}
|
415
|
+
promise = @client.make_request_async(:get, path_template, options)
|
416
|
+
|
417
|
+
promise = promise.then do |result|
|
418
|
+
http_response = result.response
|
419
|
+
status_code = http_response.status
|
420
|
+
response_content = http_response.body
|
421
|
+
unless status_code == 200
|
422
|
+
error_model = JSON.load(response_content)
|
423
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
424
|
+
end
|
425
|
+
|
426
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
427
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
428
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
429
|
+
# Deserialize Response
|
430
|
+
if status_code == 200
|
431
|
+
begin
|
432
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
433
|
+
result_mapper = Azure::OperationsManagement::Mgmt::V2015_11_01_preview::Models::ManagementAssociation.mapper()
|
434
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
435
|
+
rescue Exception => e
|
436
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
437
|
+
end
|
438
|
+
end
|
439
|
+
|
440
|
+
result
|
441
|
+
end
|
442
|
+
|
443
|
+
promise.execute
|
444
|
+
end
|
445
|
+
|
446
|
+
end
|
447
|
+
end
|