azure_mgmt_resources 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +1 -27
  3. data/azure_mgmt_resources.gemspec +1 -1
  4. data/lib/azure_mgmt_resources.rb +7 -10
  5. data/lib/azure_mgmt_resources/deployment_operations.rb +117 -16
  6. data/lib/azure_mgmt_resources/deployments.rb +416 -51
  7. data/lib/azure_mgmt_resources/models/basic_dependency.rb +1 -1
  8. data/lib/azure_mgmt_resources/models/debug_setting.rb +56 -0
  9. data/lib/azure_mgmt_resources/models/dependency.rb +1 -1
  10. data/lib/azure_mgmt_resources/models/deployment.rb +1 -1
  11. data/lib/azure_mgmt_resources/models/deployment_export_result.rb +56 -0
  12. data/lib/azure_mgmt_resources/models/deployment_extended.rb +1 -1
  13. data/lib/azure_mgmt_resources/models/deployment_extended_filter.rb +1 -1
  14. data/lib/azure_mgmt_resources/models/deployment_list_result.rb +1 -1
  15. data/lib/azure_mgmt_resources/models/deployment_mode.rb +1 -1
  16. data/lib/azure_mgmt_resources/models/deployment_operation.rb +1 -1
  17. data/lib/azure_mgmt_resources/models/deployment_operation_properties.rb +42 -1
  18. data/lib/azure_mgmt_resources/models/deployment_operations_list_result.rb +1 -1
  19. data/lib/azure_mgmt_resources/models/deployment_properties.rb +18 -1
  20. data/lib/azure_mgmt_resources/models/deployment_properties_extended.rb +18 -1
  21. data/lib/azure_mgmt_resources/models/deployment_validate_result.rb +1 -1
  22. data/lib/azure_mgmt_resources/models/export_template_request.rb +69 -0
  23. data/lib/azure_mgmt_resources/models/generic_resource.rb +1 -1
  24. data/lib/azure_mgmt_resources/models/generic_resource_filter.rb +1 -1
  25. data/lib/azure_mgmt_resources/models/http_message.rb +56 -0
  26. data/lib/azure_mgmt_resources/models/parameters_link.rb +1 -1
  27. data/lib/azure_mgmt_resources/models/plan.rb +1 -1
  28. data/lib/azure_mgmt_resources/models/provider.rb +1 -1
  29. data/lib/azure_mgmt_resources/models/provider_list_result.rb +1 -1
  30. data/lib/azure_mgmt_resources/models/provider_resource_type.rb +1 -1
  31. data/lib/azure_mgmt_resources/models/resource_group.rb +1 -1
  32. data/lib/azure_mgmt_resources/models/resource_group_export_result.rb +71 -0
  33. data/lib/azure_mgmt_resources/models/resource_group_filter.rb +1 -1
  34. data/lib/azure_mgmt_resources/models/resource_group_list_result.rb +1 -1
  35. data/lib/azure_mgmt_resources/models/resource_group_properties.rb +1 -1
  36. data/lib/azure_mgmt_resources/models/resource_list_result.rb +1 -1
  37. data/lib/azure_mgmt_resources/models/resource_management_error_with_details.rb +18 -5
  38. data/lib/azure_mgmt_resources/models/resource_provider_operation_definition.rb +1 -1
  39. data/lib/azure_mgmt_resources/models/resource_provider_operation_detail_list_result.rb +1 -1
  40. data/lib/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +1 -1
  41. data/lib/azure_mgmt_resources/models/resources_move_info.rb +1 -1
  42. data/lib/azure_mgmt_resources/models/tag_count.rb +1 -1
  43. data/lib/azure_mgmt_resources/models/tag_details.rb +1 -1
  44. data/lib/azure_mgmt_resources/models/tag_value.rb +1 -1
  45. data/lib/azure_mgmt_resources/models/tags_list_result.rb +1 -1
  46. data/lib/azure_mgmt_resources/models/target_resource.rb +1 -1
  47. data/lib/azure_mgmt_resources/models/template_link.rb +1 -1
  48. data/lib/azure_mgmt_resources/module_definition.rb +1 -1
  49. data/lib/azure_mgmt_resources/providers.rb +181 -26
  50. data/lib/azure_mgmt_resources/resource_groups.rb +461 -54
  51. data/lib/azure_mgmt_resources/resource_management_client.rb +2 -10
  52. data/lib/azure_mgmt_resources/resource_provider_operation_details.rb +73 -11
  53. data/lib/azure_mgmt_resources/resources.rb +306 -57
  54. data/lib/azure_mgmt_resources/tags.rb +207 -31
  55. data/lib/azure_mgmt_resources/version.rb +2 -2
  56. metadata +31 -29
  57. data/lib/azure_mgmt_resources/models/policy_assignment.rb +0 -72
  58. data/lib/azure_mgmt_resources/models/policy_assignment_list_result.rb +0 -86
  59. data/lib/azure_mgmt_resources/models/policy_assignment_properties.rb +0 -74
  60. data/lib/azure_mgmt_resources/models/policy_definition.rb +0 -72
  61. data/lib/azure_mgmt_resources/models/policy_definition_properties.rb +0 -74
  62. data/lib/azure_mgmt_resources/models/resource_management_error.rb +0 -76
  63. data/lib/azure_mgmt_resources/policy_assignments.rb +0 -922
  64. data/lib/azure_mgmt_resources/policy_definitions.rb +0 -208
@@ -1,208 +0,0 @@
1
- # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
3
- # Changes may cause incorrect behavior and will be lost if the code is
4
- # regenerated.
5
-
6
- module Azure::ARM::Resources
7
- #
8
- # PolicyDefinitions
9
- #
10
- class PolicyDefinitions
11
- include Azure::ARM::Resources::Models
12
- include MsRestAzure
13
-
14
- #
15
- # Creates and initializes a new instance of the PolicyDefinitions class.
16
- # @param client service class for accessing basic functionality.
17
- #
18
- def initialize(client)
19
- @client = client
20
- end
21
-
22
- # @return reference to the ResourceManagementClient
23
- attr_reader :client
24
-
25
- #
26
- # Create or update policy definition.
27
- #
28
- # @param policy_definition_name [String] The policy definition name.
29
- # @param parameters [PolicyDefinition] The policy definition properties
30
- # @param [Hash{String => String}] The hash of custom headers need to be
31
- # applied to HTTP request.
32
- #
33
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
34
- # response.
35
- #
36
- def create_or_update(policy_definition_name, parameters, custom_headers = nil)
37
- fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
38
- fail ArgumentError, 'parameters is nil' if parameters.nil?
39
- parameters.validate unless parameters.nil?
40
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
41
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
42
- request_headers = {}
43
-
44
- # Set Headers
45
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
46
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
47
-
48
- # Serialize Request
49
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
50
- unless parameters.nil?
51
- parameters = PolicyDefinition.serialize_object(parameters)
52
- end
53
- request_content = JSON.generate(parameters, quirks_mode: true)
54
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}'
55
- options = {
56
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
57
- path_params: {'policyDefinitionName' => policy_definition_name,'subscriptionId' => @client.subscription_id},
58
- query_params: {'api-version' => @client.api_version},
59
- body: request_content,
60
- headers: request_headers.merge(custom_headers || {})
61
- }
62
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
63
- promise = request.run_promise do |req|
64
- @client.credentials.sign_request(req) unless @client.credentials.nil?
65
- end
66
-
67
- promise = promise.then do |http_response|
68
- status_code = http_response.status
69
- response_content = http_response.body
70
- unless status_code == 201
71
- error_model = JSON.load(response_content)
72
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
73
- end
74
-
75
- # Create Result
76
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
77
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
78
- # Deserialize Response
79
- if status_code == 201
80
- begin
81
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
82
- unless parsed_response.nil?
83
- parsed_response = PolicyDefinition.deserialize_object(parsed_response)
84
- end
85
- result.body = parsed_response
86
- rescue Exception => e
87
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
88
- end
89
- end
90
-
91
- result
92
- end
93
-
94
- promise.execute
95
- end
96
-
97
- #
98
- # Gets policy definition.
99
- #
100
- # @param policy_definition_name [String] The policy definition name.
101
- # @param [Hash{String => String}] The hash of custom headers need to be
102
- # applied to HTTP request.
103
- #
104
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
105
- # response.
106
- #
107
- def get(policy_definition_name, custom_headers = nil)
108
- fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
109
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
110
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
111
- request_headers = {}
112
-
113
- # Set Headers
114
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
115
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
116
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}'
117
- options = {
118
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
119
- path_params: {'policyDefinitionName' => policy_definition_name,'subscriptionId' => @client.subscription_id},
120
- query_params: {'api-version' => @client.api_version},
121
- headers: request_headers.merge(custom_headers || {})
122
- }
123
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
124
- promise = request.run_promise do |req|
125
- @client.credentials.sign_request(req) unless @client.credentials.nil?
126
- end
127
-
128
- promise = promise.then do |http_response|
129
- status_code = http_response.status
130
- response_content = http_response.body
131
- unless status_code == 200
132
- error_model = JSON.load(response_content)
133
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
134
- end
135
-
136
- # Create Result
137
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
138
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
139
- # Deserialize Response
140
- if status_code == 200
141
- begin
142
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
143
- unless parsed_response.nil?
144
- parsed_response = PolicyDefinition.deserialize_object(parsed_response)
145
- end
146
- result.body = parsed_response
147
- rescue Exception => e
148
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
149
- end
150
- end
151
-
152
- result
153
- end
154
-
155
- promise.execute
156
- end
157
-
158
- #
159
- # Deletes policy definition.
160
- #
161
- # @param policy_definition_name [String] The policy definition name.
162
- # @param [Hash{String => String}] The hash of custom headers need to be
163
- # applied to HTTP request.
164
- #
165
- # @return [Concurrent::Promise] Promise object which allows to get HTTP
166
- # response.
167
- #
168
- def delete(policy_definition_name, custom_headers = nil)
169
- fail ArgumentError, 'policy_definition_name is nil' if policy_definition_name.nil?
170
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
171
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
172
- request_headers = {}
173
-
174
- # Set Headers
175
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
176
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
177
- path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}'
178
- options = {
179
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
180
- path_params: {'policyDefinitionName' => policy_definition_name,'subscriptionId' => @client.subscription_id},
181
- query_params: {'api-version' => @client.api_version},
182
- headers: request_headers.merge(custom_headers || {})
183
- }
184
- request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
185
- promise = request.run_promise do |req|
186
- @client.credentials.sign_request(req) unless @client.credentials.nil?
187
- end
188
-
189
- promise = promise.then do |http_response|
190
- status_code = http_response.status
191
- response_content = http_response.body
192
- unless status_code == 200
193
- error_model = JSON.load(response_content)
194
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
195
- end
196
-
197
- # Create Result
198
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
199
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
200
-
201
- result
202
- end
203
-
204
- promise.execute
205
- end
206
-
207
- end
208
- end