azure_mgmt_container_instance 0.17.0 → 0.17.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  3. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +1 -1
  4. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +9 -0
  5. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  6. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +1 -1
  7. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +9 -0
  8. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  9. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +1 -1
  10. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +9 -0
  11. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  12. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +1 -1
  13. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +9 -0
  14. data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  15. data/lib/2018-04-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +1 -1
  16. data/lib/2018-04-01/generated/azure_mgmt_container_instance/models/resource.rb +9 -0
  17. data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb +221 -0
  18. data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  19. data/lib/2018-06-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +1 -1
  20. data/lib/2018-06-01/generated/azure_mgmt_container_instance/models/resource.rb +9 -0
  21. data/lib/2018-09-01/generated/azure_mgmt_container_instance.rb +74 -0
  22. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb +113 -0
  23. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb +1205 -0
  24. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +145 -0
  25. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb +258 -0
  26. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  27. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container.rb +192 -0
  28. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec.rb +54 -0
  29. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb +58 -0
  30. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb +57 -0
  31. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb +57 -0
  32. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group.rb +242 -0
  33. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb +47 -0
  34. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb +16 -0
  35. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  36. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb +46 -0
  37. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  38. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  39. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  40. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_http_get.rb +68 -0
  41. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  42. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  43. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  44. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_probe.rb +114 -0
  45. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  46. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  47. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/environment_variable.rb +68 -0
  48. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  49. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  50. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  51. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/ip_address.rb +101 -0
  52. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics.rb +88 -0
  53. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb +16 -0
  54. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  55. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  56. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  57. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  58. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb +67 -0
  59. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  60. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource.rb +110 -0
  61. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_limits.rb +57 -0
  62. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requests.rb +57 -0
  63. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  64. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  65. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  66. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  67. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  68. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  69. data/lib/2018-09-01/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  70. data/lib/2018-09-01/generated/azure_mgmt_container_instance/operations.rb +107 -0
  71. data/lib/2018-10-01/generated/azure_mgmt_container_instance.rb +81 -0
  72. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_group_usage.rb +113 -0
  73. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_groups.rb +1332 -0
  74. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +149 -0
  75. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_operations.rb +258 -0
  76. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  77. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container.rb +192 -0
  78. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec.rb +54 -0
  79. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb +58 -0
  80. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb +57 -0
  81. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb +57 -0
  82. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group.rb +268 -0
  83. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb +47 -0
  84. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_identity.rb +102 -0
  85. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_identity_user_assigned_identities_value.rb +61 -0
  86. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb +16 -0
  87. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  88. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb +46 -0
  89. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  90. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  91. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  92. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_http_get.rb +68 -0
  93. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  94. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  95. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  96. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_probe.rb +114 -0
  97. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  98. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  99. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/dns_configuration.rb +77 -0
  100. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/environment_variable.rb +68 -0
  101. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  102. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  103. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/gpu_resource.rb +58 -0
  104. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/gpu_sku.rb +17 -0
  105. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  106. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/ip_address.rb +102 -0
  107. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/log_analytics.rb +88 -0
  108. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb +16 -0
  109. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  110. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  111. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  112. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  113. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb +67 -0
  114. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  115. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource.rb +110 -0
  116. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_identity_type.rb +18 -0
  117. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_limits.rb +69 -0
  118. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_requests.rb +69 -0
  119. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  120. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  121. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  122. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  123. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  124. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  125. data/lib/2018-10-01/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  126. data/lib/2018-10-01/generated/azure_mgmt_container_instance/operations.rb +107 -0
  127. data/lib/2018-10-01/generated/azure_mgmt_container_instance/service_association_link.rb +119 -0
  128. data/lib/azure_mgmt_container_instance.rb +2 -0
  129. data/lib/profiles/latest/modules/containerinstance_profile_module.rb +139 -101
  130. data/lib/version.rb +1 -1
  131. metadata +112 -5
@@ -0,0 +1,149 @@
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::V2018_10_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 [ContainerGroupUsage] container_group_usage
47
+ attr_reader :container_group_usage
48
+
49
+ # @return [ContainerOperations] container_operations
50
+ attr_reader :container_operations
51
+
52
+ # @return [ServiceAssociationLink] service_association_link
53
+ attr_reader :service_association_link
54
+
55
+ #
56
+ # Creates initializes a new instance of the ContainerInstanceManagementClient class.
57
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
58
+ # @param base_url [String] the base URI of the service.
59
+ # @param options [Array] filters to be applied to the HTTP requests.
60
+ #
61
+ def initialize(credentials = nil, base_url = nil, options = nil)
62
+ super(credentials, options)
63
+ @base_url = base_url || 'https://management.azure.com'
64
+
65
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
66
+ @credentials = credentials
67
+
68
+ @container_groups = ContainerGroups.new(self)
69
+ @operations = Operations.new(self)
70
+ @container_group_usage = ContainerGroupUsage.new(self)
71
+ @container_operations = ContainerOperations.new(self)
72
+ @service_association_link = ServiceAssociationLink.new(self)
73
+ @api_version = '2018-10-01'
74
+ @accept_language = 'en-US'
75
+ @long_running_operation_retry_timeout = 30
76
+ @generate_client_request_id = true
77
+ add_telemetry
78
+ end
79
+
80
+ #
81
+ # Makes a request and returns the body of the response.
82
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
83
+ # @param path [String] the path, relative to {base_url}.
84
+ # @param options [Hash{String=>String}] specifying any request options like :body.
85
+ # @return [Hash{String=>String}] containing the body of the response.
86
+ # Example:
87
+ #
88
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
89
+ # path = "/path"
90
+ # options = {
91
+ # body: request_content,
92
+ # query_params: {'api-version' => '2016-02-01'}
93
+ # }
94
+ # result = @client.make_request(:put, path, options)
95
+ #
96
+ def make_request(method, path, options = {})
97
+ result = make_request_with_http_info(method, path, options)
98
+ result.body unless result.nil?
99
+ end
100
+
101
+ #
102
+ # Makes a request and returns the operation response.
103
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
104
+ # @param path [String] the path, relative to {base_url}.
105
+ # @param options [Hash{String=>String}] specifying any request options like :body.
106
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
107
+ #
108
+ def make_request_with_http_info(method, path, options = {})
109
+ result = make_request_async(method, path, options).value!
110
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
111
+ result
112
+ end
113
+
114
+ #
115
+ # Makes a request asynchronously.
116
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
117
+ # @param path [String] the path, relative to {base_url}.
118
+ # @param options [Hash{String=>String}] specifying any request options like :body.
119
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
120
+ #
121
+ def make_request_async(method, path, options = {})
122
+ fail ArgumentError, 'method is nil' if method.nil?
123
+ fail ArgumentError, 'path is nil' if path.nil?
124
+
125
+ request_url = options[:base_url] || @base_url
126
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
127
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
128
+ end
129
+
130
+ request_headers = @request_headers
131
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
132
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
133
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
134
+
135
+ super(request_url, method, path, options)
136
+ end
137
+
138
+
139
+ private
140
+ #
141
+ # Adds telemetry information.
142
+ #
143
+ def add_telemetry
144
+ sdk_information = 'azure_mgmt_container_instance'
145
+ sdk_information = "#{sdk_information}/0.17.5"
146
+ add_user_agent_information(sdk_information)
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,258 @@
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::V2018_10_01
7
+ #
8
+ # ContainerOperations
9
+ #
10
+ class ContainerOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ContainerOperations 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
+ # Deserialize Response
122
+ if status_code == 200
123
+ begin
124
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
125
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::Logs.mapper()
126
+ result.body = @client.deserialize(result_mapper, parsed_response)
127
+ rescue Exception => e
128
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
129
+ end
130
+ end
131
+
132
+ result
133
+ end
134
+
135
+ promise.execute
136
+ end
137
+
138
+ #
139
+ # Executes a command in a specific container instance.
140
+ #
141
+ # Executes a command for a specific container instance in a specified resource
142
+ # group and container group.
143
+ #
144
+ # @param resource_group_name [String] The name of the resource group.
145
+ # @param container_group_name [String] The name of the container group.
146
+ # @param container_name [String] The name of the container instance.
147
+ # @param container_exec_request [ContainerExecRequest] The request for the exec
148
+ # command.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [ContainerExecResponse] operation results.
153
+ #
154
+ def execute_command(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:nil)
155
+ response = execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:custom_headers).value!
156
+ response.body unless response.nil?
157
+ end
158
+
159
+ #
160
+ # Executes a command in a specific container instance.
161
+ #
162
+ # Executes a command for a specific container instance in a specified resource
163
+ # group and container group.
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group.
166
+ # @param container_group_name [String] The name of the container group.
167
+ # @param container_name [String] The name of the container instance.
168
+ # @param container_exec_request [ContainerExecRequest] The request for the exec
169
+ # command.
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
174
+ #
175
+ def execute_command_with_http_info(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:nil)
176
+ execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:custom_headers).value!
177
+ end
178
+
179
+ #
180
+ # Executes a command in a specific container instance.
181
+ #
182
+ # Executes a command for a specific container instance in a specified resource
183
+ # group and container group.
184
+ #
185
+ # @param resource_group_name [String] The name of the resource group.
186
+ # @param container_group_name [String] The name of the container group.
187
+ # @param container_name [String] The name of the container instance.
188
+ # @param container_exec_request [ContainerExecRequest] The request for the exec
189
+ # command.
190
+ # @param [Hash{String => String}] A hash of custom headers that will be added
191
+ # to the HTTP request.
192
+ #
193
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
194
+ #
195
+ def execute_command_async(resource_group_name, container_group_name, container_name, container_exec_request, custom_headers:nil)
196
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
197
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
198
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
199
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
200
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
201
+ fail ArgumentError, 'container_exec_request is nil' if container_exec_request.nil?
202
+
203
+
204
+ request_headers = {}
205
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
206
+
207
+ # Set Headers
208
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
209
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
210
+
211
+ # Serialize Request
212
+ request_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerExecRequest.mapper()
213
+ request_content = @client.serialize(request_mapper, container_exec_request)
214
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
215
+
216
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec'
217
+
218
+ request_url = @base_url || @client.base_url
219
+
220
+ options = {
221
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
222
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name,'containerName' => container_name},
223
+ query_params: {'api-version' => @client.api_version},
224
+ body: request_content,
225
+ headers: request_headers.merge(custom_headers || {}),
226
+ base_url: request_url
227
+ }
228
+ promise = @client.make_request_async(:post, path_template, options)
229
+
230
+ promise = promise.then do |result|
231
+ http_response = result.response
232
+ status_code = http_response.status
233
+ response_content = http_response.body
234
+ unless status_code == 200
235
+ error_model = JSON.load(response_content)
236
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
237
+ end
238
+
239
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
240
+ # Deserialize Response
241
+ if status_code == 200
242
+ begin
243
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
244
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerExecResponse.mapper()
245
+ result.body = @client.deserialize(result_mapper, parsed_response)
246
+ rescue Exception => e
247
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
248
+ end
249
+ end
250
+
251
+ result
252
+ end
253
+
254
+ promise.execute
255
+ end
256
+
257
+ end
258
+ end
@@ -0,0 +1,84 @@
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::V2018_10_01
7
+ module Models
8
+ #
9
+ # The properties of the Azure File volume. Azure File shares are mounted as
10
+ # volumes.
11
+ #
12
+ class AzureFileVolume
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] The name of the Azure File share to be mounted as a
17
+ # volume.
18
+ attr_accessor :share_name
19
+
20
+ # @return [Boolean] The flag indicating whether the Azure File shared
21
+ # mounted as a volume is read-only.
22
+ attr_accessor :read_only
23
+
24
+ # @return [String] The name of the storage account that contains the
25
+ # Azure File share.
26
+ attr_accessor :storage_account_name
27
+
28
+ # @return [String] The storage account access key used to access the
29
+ # Azure File share.
30
+ attr_accessor :storage_account_key
31
+
32
+
33
+ #
34
+ # Mapper for AzureFileVolume class as Ruby Hash.
35
+ # This will be used for serialization/deserialization.
36
+ #
37
+ def self.mapper()
38
+ {
39
+ client_side_validation: true,
40
+ required: false,
41
+ serialized_name: 'AzureFileVolume',
42
+ type: {
43
+ name: 'Composite',
44
+ class_name: 'AzureFileVolume',
45
+ model_properties: {
46
+ share_name: {
47
+ client_side_validation: true,
48
+ required: true,
49
+ serialized_name: 'shareName',
50
+ type: {
51
+ name: 'String'
52
+ }
53
+ },
54
+ read_only: {
55
+ client_side_validation: true,
56
+ required: false,
57
+ serialized_name: 'readOnly',
58
+ type: {
59
+ name: 'Boolean'
60
+ }
61
+ },
62
+ storage_account_name: {
63
+ client_side_validation: true,
64
+ required: true,
65
+ serialized_name: 'storageAccountName',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ },
70
+ storage_account_key: {
71
+ client_side_validation: true,
72
+ required: false,
73
+ serialized_name: 'storageAccountKey',
74
+ type: {
75
+ name: 'String'
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ end
82
+ end
83
+ end
84
+ end