azure_mgmt_subscriptions 0.18.2 → 0.18.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2016-06-01/generated/azure_mgmt_subscriptions/subscription_client.rb +1 -1
- data/lib/2017-11-01-preview/generated/azure_mgmt_subscriptions/subscription_definitions_client.rb +1 -1
- data/lib/2018-03-01-preview/generated/azure_mgmt_subscriptions/subscription_client.rb +1 -1
- data/lib/2018-11-01-preview/generated/azure_mgmt_subscriptions/subscription_client.rb +1 -1
- data/lib/2019-03-01-preview/generated/azure_mgmt_subscriptions/subscription_client.rb +1 -1
- data/lib/2019-06-01/generated/azure_mgmt_subscriptions/subscription_client.rb +1 -1
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions.rb +44 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/ad_principal.rb +47 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/canceled_subscription_id.rb +47 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/enabled_subscription_id.rb +47 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/error_response.rb +57 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/modern_csp_subscription_creation_parameters.rb +70 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/modern_subscription_creation_parameters.rb +117 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/offer_type.rb +16 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/operation.rb +58 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/operation_display.rb +69 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/operation_list_result.rb +68 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/renamed_subscription_id.rb +47 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/subscription_creation_parameters.rb +115 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/subscription_creation_result.rb +47 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/subscription_name.rb +46 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/module_definition.rb +9 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/operations.rb +110 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/subscription.rb +788 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/subscription_client.rb +137 -0
- data/lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/subscription_operation.rb +118 -0
- data/lib/2019-11-01/generated/azure_mgmt_subscriptions/subscription_client.rb +1 -1
- data/lib/azure_mgmt_subscriptions.rb +1 -0
- data/lib/version.rb +1 -1
- metadata +22 -2
@@ -0,0 +1,137 @@
|
|
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::Subscriptions::Mgmt::V2019_10_01_preview
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class SubscriptionClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] Version of the API to be used with the client request.
|
21
|
+
# Current version is 2019-10-01-preview
|
22
|
+
attr_reader :api_version
|
23
|
+
|
24
|
+
# @return [String] The preferred language for the response.
|
25
|
+
attr_accessor :accept_language
|
26
|
+
|
27
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
28
|
+
# Operations. Default value is 30.
|
29
|
+
attr_accessor :long_running_operation_retry_timeout
|
30
|
+
|
31
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
32
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
33
|
+
# generated and included in each request. Default is true.
|
34
|
+
attr_accessor :generate_client_request_id
|
35
|
+
|
36
|
+
# @return [Subscription] subscription
|
37
|
+
attr_reader :subscription
|
38
|
+
|
39
|
+
# @return [SubscriptionOperation] subscription_operation
|
40
|
+
attr_reader :subscription_operation
|
41
|
+
|
42
|
+
# @return [Operations] operations
|
43
|
+
attr_reader :operations
|
44
|
+
|
45
|
+
#
|
46
|
+
# Creates initializes a new instance of the SubscriptionClient class.
|
47
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
48
|
+
# @param base_url [String] the base URI of the service.
|
49
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
50
|
+
#
|
51
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
52
|
+
super(credentials, options)
|
53
|
+
@base_url = base_url || 'https://management.azure.com'
|
54
|
+
|
55
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
56
|
+
@credentials = credentials
|
57
|
+
|
58
|
+
@subscription = Subscription.new(self)
|
59
|
+
@subscription_operation = SubscriptionOperation.new(self)
|
60
|
+
@operations = Operations.new(self)
|
61
|
+
@api_version = '2019-10-01-preview'
|
62
|
+
@accept_language = 'en-US'
|
63
|
+
@long_running_operation_retry_timeout = 30
|
64
|
+
@generate_client_request_id = true
|
65
|
+
add_telemetry
|
66
|
+
end
|
67
|
+
|
68
|
+
#
|
69
|
+
# Makes a request and returns the body of the response.
|
70
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
71
|
+
# @param path [String] the path, relative to {base_url}.
|
72
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
73
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
74
|
+
# Example:
|
75
|
+
#
|
76
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
77
|
+
# path = "/path"
|
78
|
+
# options = {
|
79
|
+
# body: request_content,
|
80
|
+
# query_params: {'api-version' => '2016-02-01'}
|
81
|
+
# }
|
82
|
+
# result = @client.make_request(:put, path, options)
|
83
|
+
#
|
84
|
+
def make_request(method, path, options = {})
|
85
|
+
result = make_request_with_http_info(method, path, options)
|
86
|
+
result.body unless result.nil?
|
87
|
+
end
|
88
|
+
|
89
|
+
#
|
90
|
+
# Makes a request and returns the operation response.
|
91
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
92
|
+
# @param path [String] the path, relative to {base_url}.
|
93
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
94
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
95
|
+
#
|
96
|
+
def make_request_with_http_info(method, path, options = {})
|
97
|
+
result = make_request_async(method, path, options).value!
|
98
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
99
|
+
result
|
100
|
+
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# Makes a request asynchronously.
|
104
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
105
|
+
# @param path [String] the path, relative to {base_url}.
|
106
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
107
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
108
|
+
#
|
109
|
+
def make_request_async(method, path, options = {})
|
110
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
111
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
112
|
+
|
113
|
+
request_url = options[:base_url] || @base_url
|
114
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
115
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
116
|
+
end
|
117
|
+
|
118
|
+
request_headers = @request_headers
|
119
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
120
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
121
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
122
|
+
|
123
|
+
super(request_url, method, path, options)
|
124
|
+
end
|
125
|
+
|
126
|
+
|
127
|
+
private
|
128
|
+
#
|
129
|
+
# Adds telemetry information.
|
130
|
+
#
|
131
|
+
def add_telemetry
|
132
|
+
sdk_information = 'azure_mgmt_subscriptions'
|
133
|
+
sdk_information = "#{sdk_information}/0.18.3"
|
134
|
+
add_user_agent_information(sdk_information)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,118 @@
|
|
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::Subscriptions::Mgmt::V2019_10_01_preview
|
7
|
+
#
|
8
|
+
# Subscription client provides an interface to create and manage Azure
|
9
|
+
# subscriptions programmatically.
|
10
|
+
#
|
11
|
+
class SubscriptionOperation
|
12
|
+
include MsRestAzure
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates and initializes a new instance of the SubscriptionOperation class.
|
16
|
+
# @param client service class for accessing basic functionality.
|
17
|
+
#
|
18
|
+
def initialize(client)
|
19
|
+
@client = client
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [SubscriptionClient] reference to the SubscriptionClient
|
23
|
+
attr_reader :client
|
24
|
+
|
25
|
+
#
|
26
|
+
# Get the status of the pending Microsoft.Subscription API operations.
|
27
|
+
#
|
28
|
+
# @param operation_id [String] The operation ID, which can be found from the
|
29
|
+
# Location field in the generate recommendation response header.
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
31
|
+
# will be added to the HTTP request.
|
32
|
+
#
|
33
|
+
# @return [SubscriptionCreationResult] operation results.
|
34
|
+
#
|
35
|
+
def get(operation_id, custom_headers:nil)
|
36
|
+
response = get_async(operation_id, custom_headers:custom_headers).value!
|
37
|
+
response.body unless response.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Get the status of the pending Microsoft.Subscription API operations.
|
42
|
+
#
|
43
|
+
# @param operation_id [String] The operation ID, which can be found from the
|
44
|
+
# Location field in the generate recommendation response header.
|
45
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
46
|
+
# will be added to the HTTP request.
|
47
|
+
#
|
48
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
49
|
+
#
|
50
|
+
def get_with_http_info(operation_id, custom_headers:nil)
|
51
|
+
get_async(operation_id, custom_headers:custom_headers).value!
|
52
|
+
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# Get the status of the pending Microsoft.Subscription API operations.
|
56
|
+
#
|
57
|
+
# @param operation_id [String] The operation ID, which can be found from the
|
58
|
+
# Location field in the generate recommendation response header.
|
59
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
60
|
+
# to the HTTP request.
|
61
|
+
#
|
62
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
63
|
+
#
|
64
|
+
def get_async(operation_id, custom_headers:nil)
|
65
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
66
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
67
|
+
|
68
|
+
|
69
|
+
request_headers = {}
|
70
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
71
|
+
|
72
|
+
# Set Headers
|
73
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
74
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
75
|
+
path_template = 'providers/Microsoft.Subscription/subscriptionOperations/{operationId}'
|
76
|
+
|
77
|
+
request_url = @base_url || @client.base_url
|
78
|
+
|
79
|
+
options = {
|
80
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
81
|
+
path_params: {'operationId' => operation_id},
|
82
|
+
query_params: {'api-version' => @client.api_version},
|
83
|
+
headers: request_headers.merge(custom_headers || {}),
|
84
|
+
base_url: request_url
|
85
|
+
}
|
86
|
+
promise = @client.make_request_async(:get, path_template, options)
|
87
|
+
|
88
|
+
promise = promise.then do |result|
|
89
|
+
http_response = result.response
|
90
|
+
status_code = http_response.status
|
91
|
+
response_content = http_response.body
|
92
|
+
unless status_code == 200 || status_code == 202
|
93
|
+
error_model = JSON.load(response_content)
|
94
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
95
|
+
end
|
96
|
+
|
97
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
98
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
99
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
100
|
+
# Deserialize Response
|
101
|
+
if status_code == 200
|
102
|
+
begin
|
103
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
104
|
+
result_mapper = Azure::Subscriptions::Mgmt::V2019_10_01_preview::Models::SubscriptionCreationResult.mapper()
|
105
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
106
|
+
rescue Exception => e
|
107
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
result
|
112
|
+
end
|
113
|
+
|
114
|
+
promise.execute
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
@@ -129,7 +129,7 @@ module Azure::Subscriptions::Mgmt::V2019_11_01
|
|
129
129
|
#
|
130
130
|
def add_telemetry
|
131
131
|
sdk_information = 'azure_mgmt_subscriptions'
|
132
|
-
sdk_information = "#{sdk_information}/0.18.
|
132
|
+
sdk_information = "#{sdk_information}/0.18.3"
|
133
133
|
add_user_agent_information(sdk_information)
|
134
134
|
end
|
135
135
|
end
|
@@ -4,6 +4,7 @@
|
|
4
4
|
|
5
5
|
require '2019-11-01/generated/azure_mgmt_subscriptions'
|
6
6
|
require '2018-03-01-preview/generated/azure_mgmt_subscriptions'
|
7
|
+
require '2019-10-01-preview/generated/azure_mgmt_subscriptions'
|
7
8
|
require '2018-11-01-preview/generated/azure_mgmt_subscriptions'
|
8
9
|
require '2017-11-01-preview/generated/azure_mgmt_subscriptions'
|
9
10
|
require '2016-06-01/generated/azure_mgmt_subscriptions'
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure_mgmt_subscriptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -172,6 +172,26 @@ files:
|
|
172
172
|
- lib/2019-06-01/generated/azure_mgmt_subscriptions/subscription_client.rb
|
173
173
|
- lib/2019-06-01/generated/azure_mgmt_subscriptions/subscriptions.rb
|
174
174
|
- lib/2019-06-01/generated/azure_mgmt_subscriptions/tenants.rb
|
175
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions.rb
|
176
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/ad_principal.rb
|
177
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/canceled_subscription_id.rb
|
178
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/enabled_subscription_id.rb
|
179
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/error_response.rb
|
180
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/modern_csp_subscription_creation_parameters.rb
|
181
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/modern_subscription_creation_parameters.rb
|
182
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/offer_type.rb
|
183
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/operation.rb
|
184
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/operation_display.rb
|
185
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/operation_list_result.rb
|
186
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/renamed_subscription_id.rb
|
187
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/subscription_creation_parameters.rb
|
188
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/subscription_creation_result.rb
|
189
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/models/subscription_name.rb
|
190
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/module_definition.rb
|
191
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/operations.rb
|
192
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/subscription.rb
|
193
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/subscription_client.rb
|
194
|
+
- lib/2019-10-01-preview/generated/azure_mgmt_subscriptions/subscription_operation.rb
|
175
195
|
- lib/2019-11-01/generated/azure_mgmt_subscriptions.rb
|
176
196
|
- lib/2019-11-01/generated/azure_mgmt_subscriptions/models/location.rb
|
177
197
|
- lib/2019-11-01/generated/azure_mgmt_subscriptions/models/location_list_result.rb
|