azure_mgmt_serialconsole 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3c4cc5cef37943e5203208ea9870746b54282515
4
+ data.tar.gz: 1f7853cd5b9e27530e6105d5a71a2ca5f7fb92ab
5
+ SHA512:
6
+ metadata.gz: af9e21a29ffe2881df780dd4d2bad8aa9db3a765333d1b25eba97aad0531f89e0c98b9d0730109f902e3dc5ebf852175db742634c7ab29d4f40df2a04c3052af
7
+ data.tar.gz: 5273b4a5f6719c24a36657d5c96c5c78dd90ced2861b3c8dac46babeed16d765cfa34ac408dcd9d03e643dce7be58c40a228188dcb813385698e05e3c9141ecc
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,35 @@
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 '2018-05-01/generated/azure_mgmt_serialconsole/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Serialconsole::Mgmt::V2018_05_01
23
+ autoload :List, '2018-05-01/generated/azure_mgmt_serialconsole/list.rb'
24
+ autoload :ListConsole, '2018-05-01/generated/azure_mgmt_serialconsole/list_console.rb'
25
+ autoload :Console, '2018-05-01/generated/azure_mgmt_serialconsole/console.rb'
26
+ autoload :MicrosoftSerialConsoleClient, '2018-05-01/generated/azure_mgmt_serialconsole/microsoft_serial_console_client.rb'
27
+
28
+ module Models
29
+ autoload :SetDisabledResult, '2018-05-01/generated/azure_mgmt_serialconsole/models/set_disabled_result.rb'
30
+ autoload :DeploymentValidateResult, '2018-05-01/generated/azure_mgmt_serialconsole/models/deployment_validate_result.rb'
31
+ autoload :GetDisabledResult, '2018-05-01/generated/azure_mgmt_serialconsole/models/get_disabled_result.rb'
32
+ autoload :SerialConsoleOperations, '2018-05-01/generated/azure_mgmt_serialconsole/models/serial_console_operations.rb'
33
+ autoload :SerialConsoleGetResult, '2018-05-01/generated/azure_mgmt_serialconsole/models/serial_console_get_result.rb'
34
+ end
35
+ end
@@ -0,0 +1,196 @@
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::Serialconsole::Mgmt::V2018_05_01
7
+ #
8
+ # Azure Virtual Machine Serial Console allows you to access serial console of
9
+ # a Virtual Machine
10
+ #
11
+ class Console
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Console class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [MicrosoftSerialConsoleClient] reference to the MicrosoftSerialConsoleClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Enables Serial Console for a subscription
27
+ #
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [SetDisabledResult] operation results.
32
+ #
33
+ def enable_console(custom_headers:nil)
34
+ response = enable_console_async(custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Enables Serial Console for a subscription
40
+ #
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
45
+ #
46
+ def enable_console_with_http_info(custom_headers:nil)
47
+ enable_console_async(custom_headers:custom_headers).value!
48
+ end
49
+
50
+ #
51
+ # Enables Serial Console for a subscription
52
+ #
53
+ # @param [Hash{String => String}] A hash of custom headers that will be added
54
+ # to the HTTP request.
55
+ #
56
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
57
+ #
58
+ def enable_console_async(custom_headers:nil)
59
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
60
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
61
+ default = 'default'
62
+
63
+
64
+ request_headers = {}
65
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
66
+
67
+ # Set Headers
68
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
69
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
70
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole'
71
+
72
+ request_url = @base_url || @client.base_url
73
+
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ path_params: {'subscriptionId' => @client.subscription_id,'default' => default},
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {}),
79
+ base_url: request_url
80
+ }
81
+ promise = @client.make_request_async(:post, path_template, options)
82
+
83
+ promise = promise.then do |result|
84
+ http_response = result.response
85
+ status_code = http_response.status
86
+ response_content = http_response.body
87
+ unless status_code == 200
88
+ error_model = JSON.load(response_content)
89
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
90
+ end
91
+
92
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::Serialconsole::Mgmt::V2018_05_01::Models::SetDisabledResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Disables Serial Console for a subscription
112
+ #
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ # @return [SetDisabledResult] operation results.
117
+ #
118
+ def disable_console(custom_headers:nil)
119
+ response = disable_console_async(custom_headers:custom_headers).value!
120
+ response.body unless response.nil?
121
+ end
122
+
123
+ #
124
+ # Disables Serial Console for a subscription
125
+ #
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
130
+ #
131
+ def disable_console_with_http_info(custom_headers:nil)
132
+ disable_console_async(custom_headers:custom_headers).value!
133
+ end
134
+
135
+ #
136
+ # Disables Serial Console for a subscription
137
+ #
138
+ # @param [Hash{String => String}] A hash of custom headers that will be added
139
+ # to the HTTP request.
140
+ #
141
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
142
+ #
143
+ def disable_console_async(custom_headers:nil)
144
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
145
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
146
+ default = 'default'
147
+
148
+
149
+ request_headers = {}
150
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
151
+
152
+ # Set Headers
153
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
154
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
155
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole'
156
+
157
+ request_url = @base_url || @client.base_url
158
+
159
+ options = {
160
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
161
+ path_params: {'subscriptionId' => @client.subscription_id,'default' => default},
162
+ query_params: {'api-version' => @client.api_version},
163
+ headers: request_headers.merge(custom_headers || {}),
164
+ base_url: request_url
165
+ }
166
+ promise = @client.make_request_async(:post, path_template, options)
167
+
168
+ promise = promise.then do |result|
169
+ http_response = result.response
170
+ status_code = http_response.status
171
+ response_content = http_response.body
172
+ unless status_code == 200
173
+ error_model = JSON.load(response_content)
174
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
175
+ end
176
+
177
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
178
+ # Deserialize Response
179
+ if status_code == 200
180
+ begin
181
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
182
+ result_mapper = Azure::Serialconsole::Mgmt::V2018_05_01::Models::SetDisabledResult.mapper()
183
+ result.body = @client.deserialize(result_mapper, parsed_response)
184
+ rescue Exception => e
185
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
186
+ end
187
+ end
188
+
189
+ result
190
+ end
191
+
192
+ promise.execute
193
+ end
194
+
195
+ end
196
+ end
@@ -0,0 +1,110 @@
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::Serialconsole::Mgmt::V2018_05_01
7
+ #
8
+ # Azure Virtual Machine Serial Console allows you to access serial console of
9
+ # a Virtual Machine
10
+ #
11
+ class List
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the List class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [MicrosoftSerialConsoleClient] reference to the MicrosoftSerialConsoleClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets a list of Serial Console API operations.
27
+ #
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [SerialConsoleOperations] operation results.
32
+ #
33
+ def operations(custom_headers:nil)
34
+ response = operations_async(custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Gets a list of Serial Console API operations.
40
+ #
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
45
+ #
46
+ def operations_with_http_info(custom_headers:nil)
47
+ operations_async(custom_headers:custom_headers).value!
48
+ end
49
+
50
+ #
51
+ # Gets a list of Serial Console API operations.
52
+ #
53
+ # @param [Hash{String => String}] A hash of custom headers that will be added
54
+ # to the HTTP request.
55
+ #
56
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
57
+ #
58
+ def operations_async(custom_headers:nil)
59
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
60
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
61
+
62
+
63
+ request_headers = {}
64
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
65
+
66
+ # Set Headers
67
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
68
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
69
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/operations'
70
+
71
+ request_url = @base_url || @client.base_url
72
+
73
+ options = {
74
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
75
+ path_params: {'subscriptionId' => @client.subscription_id},
76
+ query_params: {'api-version' => @client.api_version},
77
+ headers: request_headers.merge(custom_headers || {}),
78
+ base_url: request_url
79
+ }
80
+ promise = @client.make_request_async(:get, path_template, options)
81
+
82
+ promise = promise.then do |result|
83
+ http_response = result.response
84
+ status_code = http_response.status
85
+ response_content = http_response.body
86
+ unless status_code == 200
87
+ error_model = JSON.load(response_content)
88
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
89
+ end
90
+
91
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
+ # Deserialize Response
93
+ if status_code == 200
94
+ begin
95
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
96
+ result_mapper = Azure::Serialconsole::Mgmt::V2018_05_01::Models::SerialConsoleOperations.mapper()
97
+ result.body = @client.deserialize(result_mapper, parsed_response)
98
+ rescue Exception => e
99
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
100
+ end
101
+ end
102
+
103
+ result
104
+ end
105
+
106
+ promise.execute
107
+ end
108
+
109
+ end
110
+ end
@@ -0,0 +1,111 @@
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::Serialconsole::Mgmt::V2018_05_01
7
+ #
8
+ # Azure Virtual Machine Serial Console allows you to access serial console of
9
+ # a Virtual Machine
10
+ #
11
+ class ListConsole
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the ListConsole class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [MicrosoftSerialConsoleClient] reference to the MicrosoftSerialConsoleClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Gets if Serial Console is disabled for a subscription.
27
+ #
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [GetDisabledResult] operation results.
32
+ #
33
+ def disabled(custom_headers:nil)
34
+ response = disabled_async(custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Gets if Serial Console is disabled for a subscription.
40
+ #
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
45
+ #
46
+ def disabled_with_http_info(custom_headers:nil)
47
+ disabled_async(custom_headers:custom_headers).value!
48
+ end
49
+
50
+ #
51
+ # Gets if Serial Console is disabled for a subscription.
52
+ #
53
+ # @param [Hash{String => String}] A hash of custom headers that will be added
54
+ # to the HTTP request.
55
+ #
56
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
57
+ #
58
+ def disabled_async(custom_headers:nil)
59
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
60
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
61
+ default = 'default'
62
+
63
+
64
+ request_headers = {}
65
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
66
+
67
+ # Set Headers
68
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
69
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
70
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}'
71
+
72
+ request_url = @base_url || @client.base_url
73
+
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ path_params: {'subscriptionId' => @client.subscription_id,'default' => default},
77
+ query_params: {'api-version' => @client.api_version},
78
+ headers: request_headers.merge(custom_headers || {}),
79
+ base_url: request_url
80
+ }
81
+ promise = @client.make_request_async(:get, path_template, options)
82
+
83
+ promise = promise.then do |result|
84
+ http_response = result.response
85
+ status_code = http_response.status
86
+ response_content = http_response.body
87
+ unless status_code == 200
88
+ error_model = JSON.load(response_content)
89
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
90
+ end
91
+
92
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::Serialconsole::Mgmt::V2018_05_01::Models::GetDisabledResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ end
111
+ end
@@ -0,0 +1,139 @@
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::Serialconsole::Mgmt::V2018_05_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class MicrosoftSerialConsoleClient < 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] The ID of the target subscription.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The API version to use for this operation.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [List] list
39
+ attr_reader :list
40
+
41
+ # @return [ListConsole] list_console
42
+ attr_reader :list_console
43
+
44
+ # @return [Console] console
45
+ attr_reader :console
46
+
47
+ #
48
+ # Creates initializes a new instance of the MicrosoftSerialConsoleClient class.
49
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
50
+ # @param base_url [String] the base URI of the service.
51
+ # @param options [Array] filters to be applied to the HTTP requests.
52
+ #
53
+ def initialize(credentials = nil, base_url = nil, options = nil)
54
+ super(credentials, options)
55
+ @base_url = base_url || 'https://management.azure.com'
56
+
57
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
58
+ @credentials = credentials
59
+
60
+ @list = List.new(self)
61
+ @list_console = ListConsole.new(self)
62
+ @console = Console.new(self)
63
+ @api_version = '2018-05-01'
64
+ @accept_language = 'en-US'
65
+ @long_running_operation_retry_timeout = 30
66
+ @generate_client_request_id = true
67
+ add_telemetry
68
+ end
69
+
70
+ #
71
+ # Makes a request and returns the body of the response.
72
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
73
+ # @param path [String] the path, relative to {base_url}.
74
+ # @param options [Hash{String=>String}] specifying any request options like :body.
75
+ # @return [Hash{String=>String}] containing the body of the response.
76
+ # Example:
77
+ #
78
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
79
+ # path = "/path"
80
+ # options = {
81
+ # body: request_content,
82
+ # query_params: {'api-version' => '2016-02-01'}
83
+ # }
84
+ # result = @client.make_request(:put, path, options)
85
+ #
86
+ def make_request(method, path, options = {})
87
+ result = make_request_with_http_info(method, path, options)
88
+ result.body unless result.nil?
89
+ end
90
+
91
+ #
92
+ # Makes a request and returns the operation response.
93
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
94
+ # @param path [String] the path, relative to {base_url}.
95
+ # @param options [Hash{String=>String}] specifying any request options like :body.
96
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
97
+ #
98
+ def make_request_with_http_info(method, path, options = {})
99
+ result = make_request_async(method, path, options).value!
100
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
101
+ result
102
+ end
103
+
104
+ #
105
+ # Makes a request asynchronously.
106
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
107
+ # @param path [String] the path, relative to {base_url}.
108
+ # @param options [Hash{String=>String}] specifying any request options like :body.
109
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
110
+ #
111
+ def make_request_async(method, path, options = {})
112
+ fail ArgumentError, 'method is nil' if method.nil?
113
+ fail ArgumentError, 'path is nil' if path.nil?
114
+
115
+ request_url = options[:base_url] || @base_url
116
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
117
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
118
+ end
119
+
120
+ request_headers = @request_headers
121
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
122
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
123
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
124
+
125
+ super(request_url, method, path, options)
126
+ end
127
+
128
+
129
+ private
130
+ #
131
+ # Adds telemetry information.
132
+ #
133
+ def add_telemetry
134
+ sdk_information = 'azure_mgmt_serialconsole'
135
+ sdk_information = "#{sdk_information}/0.17.0"
136
+ add_user_agent_information(sdk_information)
137
+ end
138
+ end
139
+ end
@@ -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
+ module Azure::Serialconsole::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Details on Failure
10
+
11
+ # Details on Failure
12
+ #
13
+ class DeploymentValidateResult
14
+
15
+ include MsRestAzure
16
+
17
+ # @return [String] Error message
18
+ attr_accessor :error_message
19
+
20
+
21
+ #
22
+ # Mapper for DeploymentValidateResult class as Ruby Hash.
23
+ # This will be used for serialization/deserialization.
24
+ #
25
+ def self.mapper()
26
+ {
27
+ client_side_validation: true,
28
+ required: false,
29
+ serialized_name: 'DeploymentValidateResult',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'DeploymentValidateResult',
33
+ model_properties: {
34
+ error_message: {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'errorMessage',
38
+ type: {
39
+ name: 'String'
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,49 @@
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::Serialconsole::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Get Disabled result
10
+
11
+ # Returns whether or not Serial Console is disabled for this given
12
+ # subscription
13
+ #
14
+ class GetDisabledResult
15
+
16
+ include MsRestAzure
17
+
18
+ # @return [Boolean] Disabled result
19
+ attr_accessor :disabled
20
+
21
+
22
+ #
23
+ # Mapper for GetDisabledResult class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'GetDisabledResult',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'GetDisabledResult',
34
+ model_properties: {
35
+ disabled: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'disabled',
39
+ type: {
40
+ name: 'Boolean'
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
@@ -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
+ module Azure::Serialconsole::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Serial Console GET Result
10
+
11
+ # Returns whether or not Serial Console is disabled.
12
+ #
13
+ class SerialConsoleGetResult
14
+
15
+ include MsRestAzure
16
+
17
+ # @return [Boolean] Whether or not Serial Console is disabled.
18
+ attr_accessor :value
19
+
20
+
21
+ #
22
+ # Mapper for SerialConsoleGetResult class as Ruby Hash.
23
+ # This will be used for serialization/deserialization.
24
+ #
25
+ def self.mapper()
26
+ {
27
+ client_side_validation: true,
28
+ required: false,
29
+ serialized_name: 'SerialConsoleGetResult',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'SerialConsoleGetResult',
33
+ model_properties: {
34
+ value: {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'value',
38
+ type: {
39
+ name: 'Boolean'
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ end
46
+ end
47
+ end
48
+ end
@@ -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
+ module Azure::Serialconsole::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Serial Console operations
10
+
11
+ # Serial Console operations
12
+ #
13
+ class SerialConsoleOperations
14
+
15
+ include MsRestAzure
16
+
17
+ # @return [String] Serial Console operations
18
+ attr_accessor :value
19
+
20
+
21
+ #
22
+ # Mapper for SerialConsoleOperations class as Ruby Hash.
23
+ # This will be used for serialization/deserialization.
24
+ #
25
+ def self.mapper()
26
+ {
27
+ client_side_validation: true,
28
+ required: false,
29
+ serialized_name: 'SerialConsoleOperations',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'SerialConsoleOperations',
33
+ model_properties: {
34
+ value: {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'value',
38
+ type: {
39
+ name: 'String'
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,49 @@
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::Serialconsole::Mgmt::V2018_05_01
7
+ module Models
8
+ #
9
+ # Set Disabled result
10
+
11
+ # Sets disable status and returns whether or not Serial Console is now
12
+ # disabled for this given subscription
13
+ #
14
+ class SetDisabledResult
15
+
16
+ include MsRestAzure
17
+
18
+ # @return [Boolean] Disabled result
19
+ attr_accessor :disabled
20
+
21
+
22
+ #
23
+ # Mapper for SetDisabledResult class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'SetDisabledResult',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'SetDisabledResult',
34
+ model_properties: {
35
+ disabled: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'disabled',
39
+ type: {
40
+ name: 'Boolean'
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::Serialconsole end
8
+ module Azure::Serialconsole::Mgmt end
9
+ module Azure::Serialconsole::Mgmt::V2018_05_01 end
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require '2018-05-01/generated/azure_mgmt_serialconsole'
6
+ require 'profiles/latest/serialconsole_latest_profile_client'
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ module Azure end
6
+ module Azure::Serialconsole end
7
+ module Azure::Serialconsole::Mgmt end
@@ -0,0 +1,85 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'azure_mgmt_serialconsole'
6
+
7
+ module Azure::Serialconsole::Profiles::Latest
8
+ module Mgmt
9
+ List = Azure::Serialconsole::Mgmt::V2018_05_01::List
10
+ ListConsole = Azure::Serialconsole::Mgmt::V2018_05_01::ListConsole
11
+ Console = Azure::Serialconsole::Mgmt::V2018_05_01::Console
12
+
13
+ module Models
14
+ SetDisabledResult = Azure::Serialconsole::Mgmt::V2018_05_01::Models::SetDisabledResult
15
+ DeploymentValidateResult = Azure::Serialconsole::Mgmt::V2018_05_01::Models::DeploymentValidateResult
16
+ GetDisabledResult = Azure::Serialconsole::Mgmt::V2018_05_01::Models::GetDisabledResult
17
+ SerialConsoleOperations = Azure::Serialconsole::Mgmt::V2018_05_01::Models::SerialConsoleOperations
18
+ SerialConsoleGetResult = Azure::Serialconsole::Mgmt::V2018_05_01::Models::SerialConsoleGetResult
19
+ end
20
+
21
+ #
22
+ # SerialconsoleManagementClass
23
+ #
24
+ class SerialconsoleManagementClass
25
+ attr_reader :list, :list_console, :console, :configurable, :base_url, :options, :model_classes
26
+
27
+ def initialize(options = {})
28
+ if options.is_a?(Hash) && options.length == 0
29
+ @options = setup_default_options
30
+ else
31
+ @options = options
32
+ end
33
+
34
+ reset!(options)
35
+
36
+ @configurable = self
37
+ @base_url = options[:base_url].nil? ? nil:options[:base_url]
38
+ @options = options[:options].nil? ? nil:options[:options]
39
+
40
+ @client_0 = Azure::Serialconsole::Mgmt::V2018_05_01::MicrosoftSerialConsoleClient.new(configurable.credentials, base_url, options)
41
+ if(@client_0.respond_to?(:subscription_id))
42
+ @client_0.subscription_id = configurable.subscription_id
43
+ end
44
+ add_telemetry(@client_0)
45
+ @list = @client_0.list
46
+ @list_console = @client_0.list_console
47
+ @console = @client_0.console
48
+
49
+ @model_classes = ModelClasses.new
50
+ end
51
+
52
+ def add_telemetry(client)
53
+ profile_information = 'Profiles/Latest/Serialconsole/Mgmt'
54
+ client.add_user_agent_information(profile_information)
55
+ end
56
+
57
+ def method_missing(method, *args)
58
+ if @client_0.respond_to?method
59
+ @client_0.send(method, *args)
60
+ else
61
+ super
62
+ end
63
+ end
64
+
65
+ end
66
+
67
+ class ModelClasses
68
+ def set_disabled_result
69
+ Azure::Serialconsole::Mgmt::V2018_05_01::Models::SetDisabledResult
70
+ end
71
+ def deployment_validate_result
72
+ Azure::Serialconsole::Mgmt::V2018_05_01::Models::DeploymentValidateResult
73
+ end
74
+ def get_disabled_result
75
+ Azure::Serialconsole::Mgmt::V2018_05_01::Models::GetDisabledResult
76
+ end
77
+ def serial_console_operations
78
+ Azure::Serialconsole::Mgmt::V2018_05_01::Models::SerialConsoleOperations
79
+ end
80
+ def serial_console_get_result
81
+ Azure::Serialconsole::Mgmt::V2018_05_01::Models::SerialConsoleGetResult
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,40 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'profiles/latest/serialconsole_module_definition'
6
+ require 'profiles/latest/modules/serialconsole_profile_module'
7
+
8
+ module Azure::Serialconsole::Profiles::Latest
9
+ module Mgmt
10
+ #
11
+ # Client class for the Latest profile SDK.
12
+ #
13
+ class Client < SerialconsoleManagementClass
14
+ include MsRestAzure::Common::Configurable
15
+
16
+ #
17
+ # Initializes a new instance of the Client class.
18
+ # @param options [Hash] hash of client options.
19
+ # options = {
20
+ # tenant_id: 'YOUR TENANT ID',
21
+ # client_id: 'YOUR CLIENT ID',
22
+ # client_secret: 'YOUR CLIENT SECRET',
23
+ # subscription_id: 'YOUR SUBSCRIPTION ID',
24
+ # credentials: credentials,
25
+ # active_directory_settings: active_directory_settings,
26
+ # base_url: 'YOUR BASE URL',
27
+ # options: options
28
+ # }
29
+ # 'credentials' are optional and if not passed in the hash, will be obtained
30
+ # from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
31
+ #
32
+ # Also, base_url, active_directory_settings & options are optional.
33
+ #
34
+ def initialize(options = {})
35
+ super(options)
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ module Azure end
6
+ module Azure::Serialconsole end
7
+ module Azure::Serialconsole::Profiles end
8
+ module Azure::Serialconsole::Profiles::Latest end
data/lib/version.rb ADDED
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ module Azure::Serialconsole::Mgmt
6
+ VERSION = '0.17.0'
7
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: azure_mgmt_serialconsole
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.17.0
5
+ platform: ruby
6
+ authors:
7
+ - Microsoft Corporation
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-05-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: dotenv
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: ms_rest_azure
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.11.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.11.0
83
+ description:
84
+ email: azrubyteam@microsoft.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - LICENSE.txt
90
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole.rb
91
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/console.rb
92
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/list.rb
93
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/list_console.rb
94
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/microsoft_serial_console_client.rb
95
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/models/deployment_validate_result.rb
96
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/models/get_disabled_result.rb
97
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/models/serial_console_get_result.rb
98
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/models/serial_console_operations.rb
99
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/models/set_disabled_result.rb
100
+ - lib/2018-05-01/generated/azure_mgmt_serialconsole/module_definition.rb
101
+ - lib/azure_mgmt_serialconsole.rb
102
+ - lib/module_definition.rb
103
+ - lib/profiles/latest/modules/serialconsole_profile_module.rb
104
+ - lib/profiles/latest/serialconsole_latest_profile_client.rb
105
+ - lib/profiles/latest/serialconsole_module_definition.rb
106
+ - lib/version.rb
107
+ homepage: https://aka.ms/azure-sdk-for-ruby
108
+ licenses:
109
+ - MIT
110
+ metadata:
111
+ bug_tracker_uri: https://github.com/Azure/azure-sdk-for-ruby/issues
112
+ changelog_uri: https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md
113
+ documentation_uri: https://azure.microsoft.com/en-us/develop/ruby/
114
+ homepage_uri: https://aka.ms/azure-sdk-for-ruby
115
+ post_install_message:
116
+ rdoc_options: []
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 2.0.0
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 2.5.1
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: Official Ruby client library to consume Serialconsole
135
+ test_files: []