azure_mgmt_container_instance 0.17.5 → 0.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +14 -0
- data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +2 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +14 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +2 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_group_usage.rb +2 -0
- data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +14 -0
- data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +2 -0
- data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_group_usage.rb +2 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +16 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +2 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/start_container.rb +2 -0
- data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_group_usage.rb +2 -0
- data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_groups.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_logs.rb +2 -0
- data/lib/2018-04-01/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2018-04-01/generated/azure_mgmt_container_instance/start_container.rb +2 -0
- data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_group_usage.rb +2 -0
- data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb +27 -7
- data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_operations.rb +4 -0
- data/lib/2018-06-01/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb +2 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb +20 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
- data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb +4 -0
- data/lib/2018-09-01/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance.rb +26 -21
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_group_usage.rb +2 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_groups.rb +22 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +196 -1
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_operations.rb +4 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/cached_images.rb +68 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/cached_images_list_result.rb +66 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/capabilities.rb +108 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/capabilities_capabilities.rb +71 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/capabilities_list_result.rb +66 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation.rb +11 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/operations.rb +2 -0
- data/lib/2018-10-01/generated/azure_mgmt_container_instance/service_association_link.rb +2 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance.rb +90 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/container_groups.rb +1404 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +145 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/containers.rb +262 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/location.rb +552 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/cached_images.rb +57 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/cached_images_list_result.rb +98 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/capabilities.rb +108 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/capabilities_capabilities.rb +71 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/capabilities_list_result.rb +98 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container.rb +192 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_exec.rb +54 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb +58 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb +57 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb +57 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group.rb +314 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb +47 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_identity.rb +102 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_identity_user_assigned_identities_value.rb +61 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb +46 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_group_sku.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_http_get.rb +68 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_probe.rb +114 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/container_state.rb +99 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/dns_configuration.rb +77 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/encryption_properties.rb +68 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/environment_variable.rb +68 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/event.rb +107 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/gpu_resource.rb +58 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/gpu_sku.rb +17 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/init_container_definition.rb +133 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/init_container_properties_definition_instance_view.rb +96 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/ip_address.rb +102 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/log_analytics.rb +88 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/operation.rb +81 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb +99 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/port.rb +58 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/resource.rb +110 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/resource_identity_type.rb +18 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/resource_limits.rb +69 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/resource_requests.rb +69 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/scheme.rb +16 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
- data/lib/2019-12-01/generated/azure_mgmt_container_instance/operations.rb +219 -0
- data/lib/azure_mgmt_container_instance.rb +4 -3
- data/lib/profiles/latest/modules/containerinstance_profile_module.rb +174 -136
- data/lib/version.rb +1 -1
- metadata +73 -2
data/lib/2019-12-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
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::ContainerInstance::Mgmt::V2019_12_01
|
|
7
|
+
#
|
|
8
|
+
# A service client - single point of access to the REST API.
|
|
9
|
+
#
|
|
10
|
+
class ContainerInstanceManagementClient < 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] Subscription credentials which uniquely identify
|
|
21
|
+
# Microsoft Azure subscription. The subscription ID forms part of the URI
|
|
22
|
+
# for every service call.
|
|
23
|
+
attr_accessor :subscription_id
|
|
24
|
+
|
|
25
|
+
# @return [String] Client API version
|
|
26
|
+
attr_reader :api_version
|
|
27
|
+
|
|
28
|
+
# @return [String] The preferred language for the response.
|
|
29
|
+
attr_accessor :accept_language
|
|
30
|
+
|
|
31
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
|
32
|
+
# Operations. Default value is 30.
|
|
33
|
+
attr_accessor :long_running_operation_retry_timeout
|
|
34
|
+
|
|
35
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
|
36
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
|
37
|
+
# generated and included in each request. Default is true.
|
|
38
|
+
attr_accessor :generate_client_request_id
|
|
39
|
+
|
|
40
|
+
# @return [ContainerGroups] container_groups
|
|
41
|
+
attr_reader :container_groups
|
|
42
|
+
|
|
43
|
+
# @return [Operations] operations
|
|
44
|
+
attr_reader :operations
|
|
45
|
+
|
|
46
|
+
# @return [Location] location
|
|
47
|
+
attr_reader :location
|
|
48
|
+
|
|
49
|
+
# @return [Containers] containers
|
|
50
|
+
attr_reader :containers
|
|
51
|
+
|
|
52
|
+
#
|
|
53
|
+
# Creates initializes a new instance of the ContainerInstanceManagementClient class.
|
|
54
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
|
55
|
+
# @param base_url [String] the base URI of the service.
|
|
56
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
|
57
|
+
#
|
|
58
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
|
59
|
+
super(credentials, options)
|
|
60
|
+
@base_url = base_url || 'https://management.azure.com'
|
|
61
|
+
|
|
62
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
|
63
|
+
@credentials = credentials
|
|
64
|
+
|
|
65
|
+
@container_groups = ContainerGroups.new(self)
|
|
66
|
+
@operations = Operations.new(self)
|
|
67
|
+
@location = Location.new(self)
|
|
68
|
+
@containers = Containers.new(self)
|
|
69
|
+
@api_version = '2019-12-01'
|
|
70
|
+
@accept_language = 'en-US'
|
|
71
|
+
@long_running_operation_retry_timeout = 30
|
|
72
|
+
@generate_client_request_id = true
|
|
73
|
+
add_telemetry
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
#
|
|
77
|
+
# Makes a request and returns the body of the response.
|
|
78
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
|
79
|
+
# @param path [String] the path, relative to {base_url}.
|
|
80
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
|
81
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
|
82
|
+
# Example:
|
|
83
|
+
#
|
|
84
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
|
85
|
+
# path = "/path"
|
|
86
|
+
# options = {
|
|
87
|
+
# body: request_content,
|
|
88
|
+
# query_params: {'api-version' => '2016-02-01'}
|
|
89
|
+
# }
|
|
90
|
+
# result = @client.make_request(:put, path, options)
|
|
91
|
+
#
|
|
92
|
+
def make_request(method, path, options = {})
|
|
93
|
+
result = make_request_with_http_info(method, path, options)
|
|
94
|
+
result.body unless result.nil?
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
#
|
|
98
|
+
# Makes a request and returns the operation response.
|
|
99
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
|
100
|
+
# @param path [String] the path, relative to {base_url}.
|
|
101
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
|
102
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
|
103
|
+
#
|
|
104
|
+
def make_request_with_http_info(method, path, options = {})
|
|
105
|
+
result = make_request_async(method, path, options).value!
|
|
106
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
|
107
|
+
result
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
#
|
|
111
|
+
# Makes a request asynchronously.
|
|
112
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
|
113
|
+
# @param path [String] the path, relative to {base_url}.
|
|
114
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
|
115
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
116
|
+
#
|
|
117
|
+
def make_request_async(method, path, options = {})
|
|
118
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
|
119
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
|
120
|
+
|
|
121
|
+
request_url = options[:base_url] || @base_url
|
|
122
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
|
123
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
request_headers = @request_headers
|
|
127
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
|
128
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
|
129
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
|
130
|
+
|
|
131
|
+
super(request_url, method, path, options)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
private
|
|
136
|
+
#
|
|
137
|
+
# Adds telemetry information.
|
|
138
|
+
#
|
|
139
|
+
def add_telemetry
|
|
140
|
+
sdk_information = 'azure_mgmt_container_instance'
|
|
141
|
+
sdk_information = "#{sdk_information}/0.17.6"
|
|
142
|
+
add_user_agent_information(sdk_information)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,262 @@
|
|
|
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::ContainerInstance::Mgmt::V2019_12_01
|
|
7
|
+
#
|
|
8
|
+
# Containers
|
|
9
|
+
#
|
|
10
|
+
class Containers
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the Containers class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Get the logs for a specified container instance.
|
|
26
|
+
#
|
|
27
|
+
# Get the logs for a specified container instance in a specified resource group
|
|
28
|
+
# and container group.
|
|
29
|
+
#
|
|
30
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
31
|
+
# @param container_group_name [String] The name of the container group.
|
|
32
|
+
# @param container_name [String] The name of the container instance.
|
|
33
|
+
# @param tail [Integer] The number of lines to show from the tail of the
|
|
34
|
+
# container instance log. If not provided, all available logs are shown up to
|
|
35
|
+
# 4mb.
|
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
37
|
+
# will be added to the HTTP request.
|
|
38
|
+
#
|
|
39
|
+
# @return [Logs] operation results.
|
|
40
|
+
#
|
|
41
|
+
def list_logs(resource_group_name, container_group_name, container_name, tail:nil, custom_headers:nil)
|
|
42
|
+
response = list_logs_async(resource_group_name, container_group_name, container_name, tail:tail, custom_headers:custom_headers).value!
|
|
43
|
+
response.body unless response.nil?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
#
|
|
47
|
+
# Get the logs for a specified container instance.
|
|
48
|
+
#
|
|
49
|
+
# Get the logs for a specified container instance in a specified resource group
|
|
50
|
+
# and container group.
|
|
51
|
+
#
|
|
52
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
53
|
+
# @param container_group_name [String] The name of the container group.
|
|
54
|
+
# @param container_name [String] The name of the container instance.
|
|
55
|
+
# @param tail [Integer] The number of lines to show from the tail of the
|
|
56
|
+
# container instance log. If not provided, all available logs are shown up to
|
|
57
|
+
# 4mb.
|
|
58
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
59
|
+
# will be added to the HTTP request.
|
|
60
|
+
#
|
|
61
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
62
|
+
#
|
|
63
|
+
def list_logs_with_http_info(resource_group_name, container_group_name, container_name, tail:nil, custom_headers:nil)
|
|
64
|
+
list_logs_async(resource_group_name, container_group_name, container_name, tail:tail, custom_headers:custom_headers).value!
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
#
|
|
68
|
+
# Get the logs for a specified container instance.
|
|
69
|
+
#
|
|
70
|
+
# Get the logs for a specified container instance in a specified resource group
|
|
71
|
+
# and container group.
|
|
72
|
+
#
|
|
73
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
74
|
+
# @param container_group_name [String] The name of the container group.
|
|
75
|
+
# @param container_name [String] The name of the container instance.
|
|
76
|
+
# @param tail [Integer] The number of lines to show from the tail of the
|
|
77
|
+
# container instance log. If not provided, all available logs are shown up to
|
|
78
|
+
# 4mb.
|
|
79
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
80
|
+
# to the HTTP request.
|
|
81
|
+
#
|
|
82
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
83
|
+
#
|
|
84
|
+
def list_logs_async(resource_group_name, container_group_name, container_name, tail:nil, custom_headers:nil)
|
|
85
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
86
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
87
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
88
|
+
fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
|
|
89
|
+
fail ArgumentError, 'container_name is nil' if container_name.nil?
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
request_headers = {}
|
|
93
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
94
|
+
|
|
95
|
+
# Set Headers
|
|
96
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
97
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
98
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs'
|
|
99
|
+
|
|
100
|
+
request_url = @base_url || @client.base_url
|
|
101
|
+
|
|
102
|
+
options = {
|
|
103
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
104
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name},
|
|
105
|
+
query_params: {'api-version' => @client.api_version,'tail' => tail},
|
|
106
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
107
|
+
base_url: request_url
|
|
108
|
+
}
|
|
109
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
110
|
+
|
|
111
|
+
promise = promise.then do |result|
|
|
112
|
+
http_response = result.response
|
|
113
|
+
status_code = http_response.status
|
|
114
|
+
response_content = http_response.body
|
|
115
|
+
unless status_code == 200
|
|
116
|
+
error_model = JSON.load(response_content)
|
|
117
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
121
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
122
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
123
|
+
# Deserialize Response
|
|
124
|
+
if status_code == 200
|
|
125
|
+
begin
|
|
126
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
127
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::Logs.mapper()
|
|
128
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
129
|
+
rescue Exception => e
|
|
130
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
result
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
promise.execute
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
#
|
|
141
|
+
# Executes a command in a specific container instance.
|
|
142
|
+
#
|
|
143
|
+
# Executes a command for a specific container instance in a specified resource
|
|
144
|
+
# group and container group.
|
|
145
|
+
#
|
|
146
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
147
|
+
# @param container_group_name [String] The name of the container group.
|
|
148
|
+
# @param container_name [String] The name of the container instance.
|
|
149
|
+
# @param container_exec_request [ContainerExecRequest] The request for the exec
|
|
150
|
+
# command.
|
|
151
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
152
|
+
# will be added to the HTTP request.
|
|
153
|
+
#
|
|
154
|
+
# @return [ContainerExecResponse] operation results.
|
|
155
|
+
#
|
|
156
|
+
def execute_command(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:nil)
|
|
157
|
+
response = execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:custom_headers).value!
|
|
158
|
+
response.body unless response.nil?
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
#
|
|
162
|
+
# Executes a command in a specific container instance.
|
|
163
|
+
#
|
|
164
|
+
# Executes a command for a specific container instance in a specified resource
|
|
165
|
+
# group and container group.
|
|
166
|
+
#
|
|
167
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
168
|
+
# @param container_group_name [String] The name of the container group.
|
|
169
|
+
# @param container_name [String] The name of the container instance.
|
|
170
|
+
# @param container_exec_request [ContainerExecRequest] The request for the exec
|
|
171
|
+
# command.
|
|
172
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
173
|
+
# will be added to the HTTP request.
|
|
174
|
+
#
|
|
175
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
176
|
+
#
|
|
177
|
+
def execute_command_with_http_info(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:nil)
|
|
178
|
+
execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:custom_headers).value!
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
#
|
|
182
|
+
# Executes a command in a specific container instance.
|
|
183
|
+
#
|
|
184
|
+
# Executes a command for a specific container instance in a specified resource
|
|
185
|
+
# group and container group.
|
|
186
|
+
#
|
|
187
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
188
|
+
# @param container_group_name [String] The name of the container group.
|
|
189
|
+
# @param container_name [String] The name of the container instance.
|
|
190
|
+
# @param container_exec_request [ContainerExecRequest] The request for the exec
|
|
191
|
+
# command.
|
|
192
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
193
|
+
# to the HTTP request.
|
|
194
|
+
#
|
|
195
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
196
|
+
#
|
|
197
|
+
def execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:nil)
|
|
198
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
199
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
200
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
201
|
+
fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
|
|
202
|
+
fail ArgumentError, 'container_name is nil' if container_name.nil?
|
|
203
|
+
fail ArgumentError, 'container_exec_request is nil' if container_exec_request.nil?
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
request_headers = {}
|
|
207
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
208
|
+
|
|
209
|
+
# Set Headers
|
|
210
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
211
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
212
|
+
|
|
213
|
+
# Serialize Request
|
|
214
|
+
request_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::ContainerExecRequest.mapper()
|
|
215
|
+
request_content = @client.serialize(request_mapper, container_exec_request)
|
|
216
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
217
|
+
|
|
218
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'
|
|
219
|
+
|
|
220
|
+
request_url = @base_url || @client.base_url
|
|
221
|
+
|
|
222
|
+
options = {
|
|
223
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
224
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name},
|
|
225
|
+
query_params: {'api-version' => @client.api_version},
|
|
226
|
+
body: request_content,
|
|
227
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
228
|
+
base_url: request_url
|
|
229
|
+
}
|
|
230
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
231
|
+
|
|
232
|
+
promise = promise.then do |result|
|
|
233
|
+
http_response = result.response
|
|
234
|
+
status_code = http_response.status
|
|
235
|
+
response_content = http_response.body
|
|
236
|
+
unless status_code == 200
|
|
237
|
+
error_model = JSON.load(response_content)
|
|
238
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
242
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
243
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
244
|
+
# Deserialize Response
|
|
245
|
+
if status_code == 200
|
|
246
|
+
begin
|
|
247
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
248
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::ContainerExecResponse.mapper()
|
|
249
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
250
|
+
rescue Exception => e
|
|
251
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
result
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
promise.execute
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
end
|
|
262
|
+
end
|
|
@@ -0,0 +1,552 @@
|
|
|
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::ContainerInstance::Mgmt::V2019_12_01
|
|
7
|
+
#
|
|
8
|
+
# Location
|
|
9
|
+
#
|
|
10
|
+
class Location
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the Location class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Get the usage for a subscription
|
|
26
|
+
#
|
|
27
|
+
# @param location [String] The identifier for the physical azure location.
|
|
28
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
29
|
+
# will be added to the HTTP request.
|
|
30
|
+
#
|
|
31
|
+
# @return [UsageListResult] operation results.
|
|
32
|
+
#
|
|
33
|
+
def list_usage(location, custom_headers:nil)
|
|
34
|
+
response = list_usage_async(location, custom_headers:custom_headers).value!
|
|
35
|
+
response.body unless response.nil?
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
#
|
|
39
|
+
# Get the usage for a subscription
|
|
40
|
+
#
|
|
41
|
+
# @param location [String] The identifier for the physical azure location.
|
|
42
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
43
|
+
# will be added to the HTTP request.
|
|
44
|
+
#
|
|
45
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
46
|
+
#
|
|
47
|
+
def list_usage_with_http_info(location, custom_headers:nil)
|
|
48
|
+
list_usage_async(location, custom_headers:custom_headers).value!
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
#
|
|
52
|
+
# Get the usage for a subscription
|
|
53
|
+
#
|
|
54
|
+
# @param location [String] The identifier for the physical azure location.
|
|
55
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
56
|
+
# to the HTTP request.
|
|
57
|
+
#
|
|
58
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
59
|
+
#
|
|
60
|
+
def list_usage_async(location, custom_headers:nil)
|
|
61
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
62
|
+
fail ArgumentError, 'location is nil' if location.nil?
|
|
63
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
request_headers = {}
|
|
67
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
68
|
+
|
|
69
|
+
# Set Headers
|
|
70
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
71
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
72
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages'
|
|
73
|
+
|
|
74
|
+
request_url = @base_url || @client.base_url
|
|
75
|
+
|
|
76
|
+
options = {
|
|
77
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
78
|
+
path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
|
|
79
|
+
query_params: {'api-version' => @client.api_version},
|
|
80
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
81
|
+
base_url: request_url
|
|
82
|
+
}
|
|
83
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
84
|
+
|
|
85
|
+
promise = promise.then do |result|
|
|
86
|
+
http_response = result.response
|
|
87
|
+
status_code = http_response.status
|
|
88
|
+
response_content = http_response.body
|
|
89
|
+
unless status_code == 200
|
|
90
|
+
error_model = JSON.load(response_content)
|
|
91
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
95
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
96
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
97
|
+
# Deserialize Response
|
|
98
|
+
if status_code == 200
|
|
99
|
+
begin
|
|
100
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
101
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::UsageListResult.mapper()
|
|
102
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
103
|
+
rescue Exception => e
|
|
104
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
result
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
promise.execute
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
#
|
|
115
|
+
# Get the list of cached images.
|
|
116
|
+
#
|
|
117
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
118
|
+
# region.
|
|
119
|
+
#
|
|
120
|
+
# @param location [String] The identifier for the physical azure location.
|
|
121
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
122
|
+
# will be added to the HTTP request.
|
|
123
|
+
#
|
|
124
|
+
# @return [Array<CachedImages>] operation results.
|
|
125
|
+
#
|
|
126
|
+
def list_cached_images(location, custom_headers:nil)
|
|
127
|
+
first_page = list_cached_images_as_lazy(location, custom_headers:custom_headers)
|
|
128
|
+
first_page.get_all_items
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
#
|
|
132
|
+
# Get the list of cached images.
|
|
133
|
+
#
|
|
134
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
135
|
+
# region.
|
|
136
|
+
#
|
|
137
|
+
# @param location [String] The identifier for the physical azure location.
|
|
138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
139
|
+
# will be added to the HTTP request.
|
|
140
|
+
#
|
|
141
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
142
|
+
#
|
|
143
|
+
def list_cached_images_with_http_info(location, custom_headers:nil)
|
|
144
|
+
list_cached_images_async(location, custom_headers:custom_headers).value!
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
#
|
|
148
|
+
# Get the list of cached images.
|
|
149
|
+
#
|
|
150
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
151
|
+
# region.
|
|
152
|
+
#
|
|
153
|
+
# @param location [String] The identifier for the physical azure location.
|
|
154
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
155
|
+
# to the HTTP request.
|
|
156
|
+
#
|
|
157
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
158
|
+
#
|
|
159
|
+
def list_cached_images_async(location, custom_headers:nil)
|
|
160
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
161
|
+
fail ArgumentError, 'location is nil' if location.nil?
|
|
162
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
request_headers = {}
|
|
166
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
167
|
+
|
|
168
|
+
# Set Headers
|
|
169
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
170
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
171
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages'
|
|
172
|
+
|
|
173
|
+
request_url = @base_url || @client.base_url
|
|
174
|
+
|
|
175
|
+
options = {
|
|
176
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
177
|
+
path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
|
|
178
|
+
query_params: {'api-version' => @client.api_version},
|
|
179
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
180
|
+
base_url: request_url
|
|
181
|
+
}
|
|
182
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
183
|
+
|
|
184
|
+
promise = promise.then do |result|
|
|
185
|
+
http_response = result.response
|
|
186
|
+
status_code = http_response.status
|
|
187
|
+
response_content = http_response.body
|
|
188
|
+
unless status_code == 200
|
|
189
|
+
error_model = JSON.load(response_content)
|
|
190
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
194
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
195
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
196
|
+
# Deserialize Response
|
|
197
|
+
if status_code == 200
|
|
198
|
+
begin
|
|
199
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
200
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::CachedImagesListResult.mapper()
|
|
201
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
202
|
+
rescue Exception => e
|
|
203
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
result
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
promise.execute
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
#
|
|
214
|
+
# Get the list of capabilities of the location.
|
|
215
|
+
#
|
|
216
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
217
|
+
#
|
|
218
|
+
# @param location [String] The identifier for the physical azure location.
|
|
219
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
220
|
+
# will be added to the HTTP request.
|
|
221
|
+
#
|
|
222
|
+
# @return [Array<Capabilities>] operation results.
|
|
223
|
+
#
|
|
224
|
+
def list_capabilities(location, custom_headers:nil)
|
|
225
|
+
first_page = list_capabilities_as_lazy(location, custom_headers:custom_headers)
|
|
226
|
+
first_page.get_all_items
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
#
|
|
230
|
+
# Get the list of capabilities of the location.
|
|
231
|
+
#
|
|
232
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
233
|
+
#
|
|
234
|
+
# @param location [String] The identifier for the physical azure location.
|
|
235
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
236
|
+
# will be added to the HTTP request.
|
|
237
|
+
#
|
|
238
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
239
|
+
#
|
|
240
|
+
def list_capabilities_with_http_info(location, custom_headers:nil)
|
|
241
|
+
list_capabilities_async(location, custom_headers:custom_headers).value!
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
#
|
|
245
|
+
# Get the list of capabilities of the location.
|
|
246
|
+
#
|
|
247
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
248
|
+
#
|
|
249
|
+
# @param location [String] The identifier for the physical azure location.
|
|
250
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
251
|
+
# to the HTTP request.
|
|
252
|
+
#
|
|
253
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
254
|
+
#
|
|
255
|
+
def list_capabilities_async(location, custom_headers:nil)
|
|
256
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
257
|
+
fail ArgumentError, 'location is nil' if location.nil?
|
|
258
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
request_headers = {}
|
|
262
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
263
|
+
|
|
264
|
+
# Set Headers
|
|
265
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
266
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
267
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities'
|
|
268
|
+
|
|
269
|
+
request_url = @base_url || @client.base_url
|
|
270
|
+
|
|
271
|
+
options = {
|
|
272
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
273
|
+
path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
|
|
274
|
+
query_params: {'api-version' => @client.api_version},
|
|
275
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
276
|
+
base_url: request_url
|
|
277
|
+
}
|
|
278
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
279
|
+
|
|
280
|
+
promise = promise.then do |result|
|
|
281
|
+
http_response = result.response
|
|
282
|
+
status_code = http_response.status
|
|
283
|
+
response_content = http_response.body
|
|
284
|
+
unless status_code == 200
|
|
285
|
+
error_model = JSON.load(response_content)
|
|
286
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
290
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
291
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
292
|
+
# Deserialize Response
|
|
293
|
+
if status_code == 200
|
|
294
|
+
begin
|
|
295
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
296
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::CapabilitiesListResult.mapper()
|
|
297
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
298
|
+
rescue Exception => e
|
|
299
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
result
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
promise.execute
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
#
|
|
310
|
+
# Get the list of cached images.
|
|
311
|
+
#
|
|
312
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
313
|
+
# region.
|
|
314
|
+
#
|
|
315
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
316
|
+
# to List operation.
|
|
317
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
318
|
+
# will be added to the HTTP request.
|
|
319
|
+
#
|
|
320
|
+
# @return [CachedImagesListResult] operation results.
|
|
321
|
+
#
|
|
322
|
+
def list_cached_images_next(next_page_link, custom_headers:nil)
|
|
323
|
+
response = list_cached_images_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
324
|
+
response.body unless response.nil?
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
#
|
|
328
|
+
# Get the list of cached images.
|
|
329
|
+
#
|
|
330
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
331
|
+
# region.
|
|
332
|
+
#
|
|
333
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
334
|
+
# to List operation.
|
|
335
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
336
|
+
# will be added to the HTTP request.
|
|
337
|
+
#
|
|
338
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
339
|
+
#
|
|
340
|
+
def list_cached_images_next_with_http_info(next_page_link, custom_headers:nil)
|
|
341
|
+
list_cached_images_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
#
|
|
345
|
+
# Get the list of cached images.
|
|
346
|
+
#
|
|
347
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
348
|
+
# region.
|
|
349
|
+
#
|
|
350
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
351
|
+
# to List operation.
|
|
352
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
353
|
+
# to the HTTP request.
|
|
354
|
+
#
|
|
355
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
356
|
+
#
|
|
357
|
+
def list_cached_images_next_async(next_page_link, custom_headers:nil)
|
|
358
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
request_headers = {}
|
|
362
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
363
|
+
|
|
364
|
+
# Set Headers
|
|
365
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
366
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
367
|
+
path_template = '{nextLink}'
|
|
368
|
+
|
|
369
|
+
request_url = @base_url || @client.base_url
|
|
370
|
+
|
|
371
|
+
options = {
|
|
372
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
373
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
374
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
375
|
+
base_url: request_url
|
|
376
|
+
}
|
|
377
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
378
|
+
|
|
379
|
+
promise = promise.then do |result|
|
|
380
|
+
http_response = result.response
|
|
381
|
+
status_code = http_response.status
|
|
382
|
+
response_content = http_response.body
|
|
383
|
+
unless status_code == 200
|
|
384
|
+
error_model = JSON.load(response_content)
|
|
385
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
389
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
390
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
391
|
+
# Deserialize Response
|
|
392
|
+
if status_code == 200
|
|
393
|
+
begin
|
|
394
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
395
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::CachedImagesListResult.mapper()
|
|
396
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
397
|
+
rescue Exception => e
|
|
398
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
399
|
+
end
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
result
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
promise.execute
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
#
|
|
409
|
+
# Get the list of capabilities of the location.
|
|
410
|
+
#
|
|
411
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
412
|
+
#
|
|
413
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
414
|
+
# to List operation.
|
|
415
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
416
|
+
# will be added to the HTTP request.
|
|
417
|
+
#
|
|
418
|
+
# @return [CapabilitiesListResult] operation results.
|
|
419
|
+
#
|
|
420
|
+
def list_capabilities_next(next_page_link, custom_headers:nil)
|
|
421
|
+
response = list_capabilities_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
422
|
+
response.body unless response.nil?
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
#
|
|
426
|
+
# Get the list of capabilities of the location.
|
|
427
|
+
#
|
|
428
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
429
|
+
#
|
|
430
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
431
|
+
# to List operation.
|
|
432
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
433
|
+
# will be added to the HTTP request.
|
|
434
|
+
#
|
|
435
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
436
|
+
#
|
|
437
|
+
def list_capabilities_next_with_http_info(next_page_link, custom_headers:nil)
|
|
438
|
+
list_capabilities_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
#
|
|
442
|
+
# Get the list of capabilities of the location.
|
|
443
|
+
#
|
|
444
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
445
|
+
#
|
|
446
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
447
|
+
# to List operation.
|
|
448
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
449
|
+
# to the HTTP request.
|
|
450
|
+
#
|
|
451
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
452
|
+
#
|
|
453
|
+
def list_capabilities_next_async(next_page_link, custom_headers:nil)
|
|
454
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
request_headers = {}
|
|
458
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
459
|
+
|
|
460
|
+
# Set Headers
|
|
461
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
462
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
463
|
+
path_template = '{nextLink}'
|
|
464
|
+
|
|
465
|
+
request_url = @base_url || @client.base_url
|
|
466
|
+
|
|
467
|
+
options = {
|
|
468
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
469
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
470
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
471
|
+
base_url: request_url
|
|
472
|
+
}
|
|
473
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
474
|
+
|
|
475
|
+
promise = promise.then do |result|
|
|
476
|
+
http_response = result.response
|
|
477
|
+
status_code = http_response.status
|
|
478
|
+
response_content = http_response.body
|
|
479
|
+
unless status_code == 200
|
|
480
|
+
error_model = JSON.load(response_content)
|
|
481
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
485
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
486
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
487
|
+
# Deserialize Response
|
|
488
|
+
if status_code == 200
|
|
489
|
+
begin
|
|
490
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
491
|
+
result_mapper = Azure::ContainerInstance::Mgmt::V2019_12_01::Models::CapabilitiesListResult.mapper()
|
|
492
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
493
|
+
rescue Exception => e
|
|
494
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
495
|
+
end
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
result
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
promise.execute
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
#
|
|
505
|
+
# Get the list of cached images.
|
|
506
|
+
#
|
|
507
|
+
# Get the list of cached images on specific OS type for a subscription in a
|
|
508
|
+
# region.
|
|
509
|
+
#
|
|
510
|
+
# @param location [String] The identifier for the physical azure location.
|
|
511
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
512
|
+
# will be added to the HTTP request.
|
|
513
|
+
#
|
|
514
|
+
# @return [CachedImagesListResult] which provide lazy access to pages of the
|
|
515
|
+
# response.
|
|
516
|
+
#
|
|
517
|
+
def list_cached_images_as_lazy(location, custom_headers:nil)
|
|
518
|
+
response = list_cached_images_async(location, custom_headers:custom_headers).value!
|
|
519
|
+
unless response.nil?
|
|
520
|
+
page = response.body
|
|
521
|
+
page.next_method = Proc.new do |next_page_link|
|
|
522
|
+
list_cached_images_next_async(next_page_link, custom_headers:custom_headers)
|
|
523
|
+
end
|
|
524
|
+
page
|
|
525
|
+
end
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
#
|
|
529
|
+
# Get the list of capabilities of the location.
|
|
530
|
+
#
|
|
531
|
+
# Get the list of CPU/memory/GPU capabilities of a region.
|
|
532
|
+
#
|
|
533
|
+
# @param location [String] The identifier for the physical azure location.
|
|
534
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
535
|
+
# will be added to the HTTP request.
|
|
536
|
+
#
|
|
537
|
+
# @return [CapabilitiesListResult] which provide lazy access to pages of the
|
|
538
|
+
# response.
|
|
539
|
+
#
|
|
540
|
+
def list_capabilities_as_lazy(location, custom_headers:nil)
|
|
541
|
+
response = list_capabilities_async(location, custom_headers:custom_headers).value!
|
|
542
|
+
unless response.nil?
|
|
543
|
+
page = response.body
|
|
544
|
+
page.next_method = Proc.new do |next_page_link|
|
|
545
|
+
list_capabilities_next_async(next_page_link, custom_headers:custom_headers)
|
|
546
|
+
end
|
|
547
|
+
page
|
|
548
|
+
end
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
end
|
|
552
|
+
end
|