azure_mgmt_container_instance 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  3. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  4. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  5. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  6. data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  7. data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb +221 -0
  8. data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  9. data/lib/2018-09-01/generated/azure_mgmt_container_instance.rb +74 -0
  10. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_group_usage.rb +113 -0
  11. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_groups.rb +1205 -0
  12. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +145 -0
  13. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_operations.rb +258 -0
  14. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  15. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container.rb +192 -0
  16. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec.rb +54 -0
  17. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb +58 -0
  18. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb +57 -0
  19. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb +57 -0
  20. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group.rb +242 -0
  21. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb +47 -0
  22. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb +16 -0
  23. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  24. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb +46 -0
  25. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  26. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  27. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  28. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_http_get.rb +68 -0
  29. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  30. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  31. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  32. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_probe.rb +114 -0
  33. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  34. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  35. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/environment_variable.rb +68 -0
  36. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  37. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  38. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  39. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/ip_address.rb +101 -0
  40. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics.rb +88 -0
  41. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb +16 -0
  42. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  43. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  44. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  45. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  46. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb +67 -0
  47. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  48. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource.rb +110 -0
  49. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_limits.rb +57 -0
  50. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requests.rb +57 -0
  51. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  52. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  53. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  54. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  55. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  56. data/lib/2018-09-01/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  57. data/lib/2018-09-01/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  58. data/lib/2018-09-01/generated/azure_mgmt_container_instance/operations.rb +107 -0
  59. data/lib/2018-10-01/generated/azure_mgmt_container_instance.rb +81 -0
  60. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_group_usage.rb +113 -0
  61. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_groups.rb +1205 -0
  62. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +149 -0
  63. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_operations.rb +258 -0
  64. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  65. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container.rb +192 -0
  66. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec.rb +54 -0
  67. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb +58 -0
  68. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb +57 -0
  69. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb +57 -0
  70. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group.rb +268 -0
  71. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb +47 -0
  72. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_identity.rb +102 -0
  73. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_identity_user_assigned_identities_value.rb +61 -0
  74. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb +16 -0
  75. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  76. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb +46 -0
  77. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  78. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  79. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  80. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_http_get.rb +68 -0
  81. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  82. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  83. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  84. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_probe.rb +114 -0
  85. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  86. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  87. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/dns_configuration.rb +77 -0
  88. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/environment_variable.rb +68 -0
  89. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  90. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  91. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/gpu_resource.rb +58 -0
  92. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/gpu_sku.rb +17 -0
  93. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  94. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/ip_address.rb +102 -0
  95. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/log_analytics.rb +88 -0
  96. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb +16 -0
  97. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  98. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  99. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  100. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  101. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb +67 -0
  102. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  103. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource.rb +110 -0
  104. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_identity_type.rb +18 -0
  105. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_limits.rb +69 -0
  106. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_requests.rb +69 -0
  107. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  108. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  109. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  110. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  111. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  112. data/lib/2018-10-01/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  113. data/lib/2018-10-01/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  114. data/lib/2018-10-01/generated/azure_mgmt_container_instance/operations.rb +107 -0
  115. data/lib/2018-10-01/generated/azure_mgmt_container_instance/service_association_link.rb +119 -0
  116. data/lib/azure_mgmt_container_instance.rb +2 -0
  117. data/lib/profiles/latest/modules/containerinstance_profile_module.rb +139 -101
  118. data/lib/version.rb +1 -1
  119. metadata +109 -2
@@ -0,0 +1,81 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2018-10-01/generated/azure_mgmt_container_instance/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ContainerInstance::Mgmt::V2018_10_01
23
+ autoload :ContainerGroups, '2018-10-01/generated/azure_mgmt_container_instance/container_groups.rb'
24
+ autoload :Operations, '2018-10-01/generated/azure_mgmt_container_instance/operations.rb'
25
+ autoload :ContainerGroupUsage, '2018-10-01/generated/azure_mgmt_container_instance/container_group_usage.rb'
26
+ autoload :ContainerOperations, '2018-10-01/generated/azure_mgmt_container_instance/container_operations.rb'
27
+ autoload :ServiceAssociationLink, '2018-10-01/generated/azure_mgmt_container_instance/service_association_link.rb'
28
+ autoload :ContainerInstanceManagementClient, '2018-10-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb'
29
+
30
+ module Models
31
+ autoload :Port, '2018-10-01/generated/azure_mgmt_container_instance/models/port.rb'
32
+ autoload :ContainerPort, '2018-10-01/generated/azure_mgmt_container_instance/models/container_port.rb'
33
+ autoload :IpAddress, '2018-10-01/generated/azure_mgmt_container_instance/models/ip_address.rb'
34
+ autoload :ContainerState, '2018-10-01/generated/azure_mgmt_container_instance/models/container_state.rb'
35
+ autoload :ContainerGroupPropertiesInstanceView, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb'
36
+ autoload :ContainerPropertiesInstanceView, '2018-10-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb'
37
+ autoload :LogAnalytics, '2018-10-01/generated/azure_mgmt_container_instance/models/log_analytics.rb'
38
+ autoload :ResourceRequests, '2018-10-01/generated/azure_mgmt_container_instance/models/resource_requests.rb'
39
+ autoload :ContainerGroupDiagnostics, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb'
40
+ autoload :ResourceRequirements, '2018-10-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb'
41
+ autoload :ContainerGroupNetworkProfile, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb'
42
+ autoload :ContainerExec, '2018-10-01/generated/azure_mgmt_container_instance/models/container_exec.rb'
43
+ autoload :DnsConfiguration, '2018-10-01/generated/azure_mgmt_container_instance/models/dns_configuration.rb'
44
+ autoload :ContainerProbe, '2018-10-01/generated/azure_mgmt_container_instance/models/container_probe.rb'
45
+ autoload :Container, '2018-10-01/generated/azure_mgmt_container_instance/models/container.rb'
46
+ autoload :GitRepoVolume, '2018-10-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb'
47
+ autoload :OperationDisplay, '2018-10-01/generated/azure_mgmt_container_instance/models/operation_display.rb'
48
+ autoload :ContainerGroupIdentityUserAssignedIdentitiesValue, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_identity_user_assigned_identities_value.rb'
49
+ autoload :Operation, '2018-10-01/generated/azure_mgmt_container_instance/models/operation.rb'
50
+ autoload :ImageRegistryCredential, '2018-10-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb'
51
+ autoload :OperationListResult, '2018-10-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb'
52
+ autoload :Event, '2018-10-01/generated/azure_mgmt_container_instance/models/event.rb'
53
+ autoload :UsageName, '2018-10-01/generated/azure_mgmt_container_instance/models/usage_name.rb'
54
+ autoload :ResourceLimits, '2018-10-01/generated/azure_mgmt_container_instance/models/resource_limits.rb'
55
+ autoload :Usage, '2018-10-01/generated/azure_mgmt_container_instance/models/usage.rb'
56
+ autoload :ContainerHttpGet, '2018-10-01/generated/azure_mgmt_container_instance/models/container_http_get.rb'
57
+ autoload :UsageListResult, '2018-10-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb'
58
+ autoload :Volume, '2018-10-01/generated/azure_mgmt_container_instance/models/volume.rb'
59
+ autoload :ContainerGroupListResult, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb'
60
+ autoload :EnvironmentVariable, '2018-10-01/generated/azure_mgmt_container_instance/models/environment_variable.rb'
61
+ autoload :Logs, '2018-10-01/generated/azure_mgmt_container_instance/models/logs.rb'
62
+ autoload :VolumeMount, '2018-10-01/generated/azure_mgmt_container_instance/models/volume_mount.rb'
63
+ autoload :ContainerExecRequestTerminalSize, '2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb'
64
+ autoload :ContainerGroupIdentity, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_identity.rb'
65
+ autoload :ContainerExecRequest, '2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb'
66
+ autoload :AzureFileVolume, '2018-10-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb'
67
+ autoload :ContainerExecResponse, '2018-10-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb'
68
+ autoload :GpuResource, '2018-10-01/generated/azure_mgmt_container_instance/models/gpu_resource.rb'
69
+ autoload :Resource, '2018-10-01/generated/azure_mgmt_container_instance/models/resource.rb'
70
+ autoload :ContainerGroup, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group.rb'
71
+ autoload :ContainerNetworkProtocol, '2018-10-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb'
72
+ autoload :GpuSku, '2018-10-01/generated/azure_mgmt_container_instance/models/gpu_sku.rb'
73
+ autoload :ResourceIdentityType, '2018-10-01/generated/azure_mgmt_container_instance/models/resource_identity_type.rb'
74
+ autoload :ContainerGroupRestartPolicy, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb'
75
+ autoload :ContainerGroupNetworkProtocol, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb'
76
+ autoload :ContainerGroupIpAddressType, '2018-10-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb'
77
+ autoload :OperatingSystemTypes, '2018-10-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb'
78
+ autoload :LogAnalyticsLogType, '2018-10-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb'
79
+ autoload :ContainerInstanceOperationsOrigin, '2018-10-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb'
80
+ end
81
+ end
@@ -0,0 +1,113 @@
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
+ # ContainerGroupUsage
9
+ #
10
+ class ContainerGroupUsage
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ContainerGroupUsage 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(location, custom_headers:nil)
34
+ response = list_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_with_http_info(location, custom_headers:nil)
48
+ list_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_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
+ # Deserialize Response
96
+ if status_code == 200
97
+ begin
98
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::UsageListResult.mapper()
100
+ result.body = @client.deserialize(result_mapper, parsed_response)
101
+ rescue Exception => e
102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
103
+ end
104
+ end
105
+
106
+ result
107
+ end
108
+
109
+ promise.execute
110
+ end
111
+
112
+ end
113
+ end
@@ -0,0 +1,1205 @@
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
+ # ContainerGroups
9
+ #
10
+ class ContainerGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ContainerGroups 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 a list of container groups in the specified subscription.
26
+ #
27
+ # Get a list of container groups in the specified subscription. This operation
28
+ # returns properties of each container group including containers, image
29
+ # registry credentials, restart policy, IP address type, OS type, state, and
30
+ # volumes.
31
+ #
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Array<ContainerGroup>] operation results.
36
+ #
37
+ def list(custom_headers:nil)
38
+ first_page = list_as_lazy(custom_headers:custom_headers)
39
+ first_page.get_all_items
40
+ end
41
+
42
+ #
43
+ # Get a list of container groups in the specified subscription.
44
+ #
45
+ # Get a list of container groups in the specified subscription. This operation
46
+ # returns properties of each container group including containers, image
47
+ # registry credentials, restart policy, IP address type, OS type, state, and
48
+ # volumes.
49
+ #
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_with_http_info(custom_headers:nil)
56
+ list_async(custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get a list of container groups in the specified subscription.
61
+ #
62
+ # Get a list of container groups in the specified subscription. This operation
63
+ # returns properties of each container group including containers, image
64
+ # registry credentials, restart policy, IP address type, OS type, state, and
65
+ # volumes.
66
+ #
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_async(custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'subscriptionId' => @client.subscription_id},
90
+ query_params: {'api-version' => @client.api_version},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroupListResult.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Get a list of container groups in the specified subscription and resource
125
+ # group.
126
+ #
127
+ # Get a list of container groups in a specified subscription and resource
128
+ # group. This operation returns properties of each container group including
129
+ # containers, image registry credentials, restart policy, IP address type, OS
130
+ # type, state, and volumes.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [Array<ContainerGroup>] operation results.
137
+ #
138
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
139
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
140
+ first_page.get_all_items
141
+ end
142
+
143
+ #
144
+ # Get a list of container groups in the specified subscription and resource
145
+ # group.
146
+ #
147
+ # Get a list of container groups in a specified subscription and resource
148
+ # group. This operation returns properties of each container group including
149
+ # containers, image registry credentials, restart policy, IP address type, OS
150
+ # type, state, and volumes.
151
+ #
152
+ # @param resource_group_name [String] The name of the resource group.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
159
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Get a list of container groups in the specified subscription and resource
164
+ # group.
165
+ #
166
+ # Get a list of container groups in a specified subscription and resource
167
+ # group. This operation returns properties of each container group including
168
+ # containers, image registry credentials, restart policy, IP address type, OS
169
+ # type, state, and volumes.
170
+ #
171
+ # @param resource_group_name [String] The name of the resource group.
172
+ # @param [Hash{String => String}] A hash of custom headers that will be added
173
+ # to the HTTP request.
174
+ #
175
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
176
+ #
177
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
178
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
179
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
180
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
181
+
182
+
183
+ request_headers = {}
184
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
185
+
186
+ # Set Headers
187
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
188
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
189
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups'
190
+
191
+ request_url = @base_url || @client.base_url
192
+
193
+ options = {
194
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
195
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
196
+ query_params: {'api-version' => @client.api_version},
197
+ headers: request_headers.merge(custom_headers || {}),
198
+ base_url: request_url
199
+ }
200
+ promise = @client.make_request_async(:get, path_template, options)
201
+
202
+ promise = promise.then do |result|
203
+ http_response = result.response
204
+ status_code = http_response.status
205
+ response_content = http_response.body
206
+ unless status_code == 200
207
+ error_model = JSON.load(response_content)
208
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
209
+ end
210
+
211
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
212
+ # Deserialize Response
213
+ if status_code == 200
214
+ begin
215
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
216
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroupListResult.mapper()
217
+ result.body = @client.deserialize(result_mapper, parsed_response)
218
+ rescue Exception => e
219
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
220
+ end
221
+ end
222
+
223
+ result
224
+ end
225
+
226
+ promise.execute
227
+ end
228
+
229
+ #
230
+ # Get the properties of the specified container group.
231
+ #
232
+ # Gets the properties of the specified container group in the specified
233
+ # subscription and resource group. The operation returns the properties of each
234
+ # container group including containers, image registry credentials, restart
235
+ # policy, IP address type, OS type, state, and volumes.
236
+ #
237
+ # @param resource_group_name [String] The name of the resource group.
238
+ # @param container_group_name [String] The name of the container group.
239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
240
+ # will be added to the HTTP request.
241
+ #
242
+ # @return [ContainerGroup] operation results.
243
+ #
244
+ def get(resource_group_name, container_group_name, custom_headers:nil)
245
+ response = get_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
246
+ response.body unless response.nil?
247
+ end
248
+
249
+ #
250
+ # Get the properties of the specified container group.
251
+ #
252
+ # Gets the properties of the specified container group in the specified
253
+ # subscription and resource group. The operation returns the properties of each
254
+ # container group including containers, image registry credentials, restart
255
+ # policy, IP address type, OS type, state, and volumes.
256
+ #
257
+ # @param resource_group_name [String] The name of the resource group.
258
+ # @param container_group_name [String] The name of the container group.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
263
+ #
264
+ def get_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
265
+ get_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
266
+ end
267
+
268
+ #
269
+ # Get the properties of the specified container group.
270
+ #
271
+ # Gets the properties of the specified container group in the specified
272
+ # subscription and resource group. The operation returns the properties of each
273
+ # container group including containers, image registry credentials, restart
274
+ # policy, IP address type, OS type, state, and volumes.
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group.
277
+ # @param container_group_name [String] The name of the container group.
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def get_async(resource_group_name, container_group_name, custom_headers:nil)
284
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
285
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
286
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
287
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
288
+
289
+
290
+ request_headers = {}
291
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
+
293
+ # Set Headers
294
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
297
+
298
+ request_url = @base_url || @client.base_url
299
+
300
+ options = {
301
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
302
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
303
+ query_params: {'api-version' => @client.api_version},
304
+ headers: request_headers.merge(custom_headers || {}),
305
+ base_url: request_url
306
+ }
307
+ promise = @client.make_request_async(:get, path_template, options)
308
+
309
+ promise = promise.then do |result|
310
+ http_response = result.response
311
+ status_code = http_response.status
312
+ response_content = http_response.body
313
+ unless status_code == 200
314
+ error_model = JSON.load(response_content)
315
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
316
+ end
317
+
318
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
319
+ # Deserialize Response
320
+ if status_code == 200
321
+ begin
322
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
323
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
324
+ result.body = @client.deserialize(result_mapper, parsed_response)
325
+ rescue Exception => e
326
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
327
+ end
328
+ end
329
+
330
+ result
331
+ end
332
+
333
+ promise.execute
334
+ end
335
+
336
+ #
337
+ # Create or update container groups.
338
+ #
339
+ # Create or update container groups with specified configurations.
340
+ #
341
+ # @param resource_group_name [String] The name of the resource group.
342
+ # @param container_group_name [String] The name of the container group.
343
+ # @param container_group [ContainerGroup] The properties of the container group
344
+ # to be created or updated.
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [ContainerGroup] operation results.
349
+ #
350
+ def create_or_update(resource_group_name, container_group_name, container_group, custom_headers:nil)
351
+ response = create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
352
+ response.body unless response.nil?
353
+ end
354
+
355
+ #
356
+ # @param resource_group_name [String] The name of the resource group.
357
+ # @param container_group_name [String] The name of the container group.
358
+ # @param container_group [ContainerGroup] The properties of the container group
359
+ # to be created or updated.
360
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
361
+ # will be added to the HTTP request.
362
+ #
363
+ # @return [Concurrent::Promise] promise which provides async access to http
364
+ # response.
365
+ #
366
+ def create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:nil)
367
+ # Send request
368
+ promise = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers)
369
+
370
+ promise = promise.then do |response|
371
+ # Defining deserialization method.
372
+ deserialize_method = lambda do |parsed_response|
373
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
374
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
375
+ end
376
+
377
+ # Waiting for response.
378
+ @client.get_long_running_operation_result(response, deserialize_method)
379
+ end
380
+
381
+ promise
382
+ end
383
+
384
+ #
385
+ # Update container groups.
386
+ #
387
+ # Updates container group tags with specified values.
388
+ #
389
+ # @param resource_group_name [String] The name of the resource group.
390
+ # @param container_group_name [String] The name of the container group.
391
+ # @param resource [Resource] The container group resource with just the tags to
392
+ # be updated.
393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
394
+ # will be added to the HTTP request.
395
+ #
396
+ # @return [ContainerGroup] operation results.
397
+ #
398
+ def update(resource_group_name, container_group_name, resource, custom_headers:nil)
399
+ response = update_async(resource_group_name, container_group_name, resource, custom_headers:custom_headers).value!
400
+ response.body unless response.nil?
401
+ end
402
+
403
+ #
404
+ # Update container groups.
405
+ #
406
+ # Updates container group tags with specified values.
407
+ #
408
+ # @param resource_group_name [String] The name of the resource group.
409
+ # @param container_group_name [String] The name of the container group.
410
+ # @param resource [Resource] The container group resource with just the tags to
411
+ # be updated.
412
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
413
+ # will be added to the HTTP request.
414
+ #
415
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
416
+ #
417
+ def update_with_http_info(resource_group_name, container_group_name, resource, custom_headers:nil)
418
+ update_async(resource_group_name, container_group_name, resource, custom_headers:custom_headers).value!
419
+ end
420
+
421
+ #
422
+ # Update container groups.
423
+ #
424
+ # Updates container group tags with specified values.
425
+ #
426
+ # @param resource_group_name [String] The name of the resource group.
427
+ # @param container_group_name [String] The name of the container group.
428
+ # @param resource [Resource] The container group resource with just the tags to
429
+ # be updated.
430
+ # @param [Hash{String => String}] A hash of custom headers that will be added
431
+ # to the HTTP request.
432
+ #
433
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
434
+ #
435
+ def update_async(resource_group_name, container_group_name, resource, custom_headers:nil)
436
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
437
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
438
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
439
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
440
+ fail ArgumentError, 'resource is nil' if resource.nil?
441
+
442
+
443
+ request_headers = {}
444
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
445
+
446
+ # Set Headers
447
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
448
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
449
+
450
+ # Serialize Request
451
+ request_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::Resource.mapper()
452
+ request_content = @client.serialize(request_mapper, resource)
453
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
454
+
455
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
456
+
457
+ request_url = @base_url || @client.base_url
458
+
459
+ options = {
460
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
461
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
462
+ query_params: {'api-version' => @client.api_version},
463
+ body: request_content,
464
+ headers: request_headers.merge(custom_headers || {}),
465
+ base_url: request_url
466
+ }
467
+ promise = @client.make_request_async(:patch, path_template, options)
468
+
469
+ promise = promise.then do |result|
470
+ http_response = result.response
471
+ status_code = http_response.status
472
+ response_content = http_response.body
473
+ unless status_code == 200
474
+ error_model = JSON.load(response_content)
475
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
476
+ end
477
+
478
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
479
+ # Deserialize Response
480
+ if status_code == 200
481
+ begin
482
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
483
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
484
+ result.body = @client.deserialize(result_mapper, parsed_response)
485
+ rescue Exception => e
486
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
487
+ end
488
+ end
489
+
490
+ result
491
+ end
492
+
493
+ promise.execute
494
+ end
495
+
496
+ #
497
+ # Delete the specified container group.
498
+ #
499
+ # Delete the specified container group in the specified subscription and
500
+ # resource group. The operation does not delete other resources provided by the
501
+ # user, such as volumes.
502
+ #
503
+ # @param resource_group_name [String] The name of the resource group.
504
+ # @param container_group_name [String] The name of the container group.
505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
506
+ # will be added to the HTTP request.
507
+ #
508
+ # @return [ContainerGroup] operation results.
509
+ #
510
+ def delete(resource_group_name, container_group_name, custom_headers:nil)
511
+ response = delete_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
512
+ response.body unless response.nil?
513
+ end
514
+
515
+ #
516
+ # Delete the specified container group.
517
+ #
518
+ # Delete the specified container group in the specified subscription and
519
+ # resource group. The operation does not delete other resources provided by the
520
+ # user, such as volumes.
521
+ #
522
+ # @param resource_group_name [String] The name of the resource group.
523
+ # @param container_group_name [String] The name of the container group.
524
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
525
+ # will be added to the HTTP request.
526
+ #
527
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
528
+ #
529
+ def delete_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
530
+ delete_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
531
+ end
532
+
533
+ #
534
+ # Delete the specified container group.
535
+ #
536
+ # Delete the specified container group in the specified subscription and
537
+ # resource group. The operation does not delete other resources provided by the
538
+ # user, such as volumes.
539
+ #
540
+ # @param resource_group_name [String] The name of the resource group.
541
+ # @param container_group_name [String] The name of the container group.
542
+ # @param [Hash{String => String}] A hash of custom headers that will be added
543
+ # to the HTTP request.
544
+ #
545
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
546
+ #
547
+ def delete_async(resource_group_name, container_group_name, custom_headers:nil)
548
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
549
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
550
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
551
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
552
+
553
+
554
+ request_headers = {}
555
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
556
+
557
+ # Set Headers
558
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
559
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
560
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
561
+
562
+ request_url = @base_url || @client.base_url
563
+
564
+ options = {
565
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
566
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
567
+ query_params: {'api-version' => @client.api_version},
568
+ headers: request_headers.merge(custom_headers || {}),
569
+ base_url: request_url
570
+ }
571
+ promise = @client.make_request_async(:delete, path_template, options)
572
+
573
+ promise = promise.then do |result|
574
+ http_response = result.response
575
+ status_code = http_response.status
576
+ response_content = http_response.body
577
+ unless status_code == 200 || status_code == 204
578
+ error_model = JSON.load(response_content)
579
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
580
+ end
581
+
582
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
583
+ # Deserialize Response
584
+ if status_code == 200
585
+ begin
586
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
587
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
588
+ result.body = @client.deserialize(result_mapper, parsed_response)
589
+ rescue Exception => e
590
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
591
+ end
592
+ end
593
+
594
+ result
595
+ end
596
+
597
+ promise.execute
598
+ end
599
+
600
+ #
601
+ # Restarts all containers in a container group.
602
+ #
603
+ # Restarts all containers in a container group in place. If container image has
604
+ # updates, new image will be downloaded.
605
+ #
606
+ # @param resource_group_name [String] The name of the resource group.
607
+ # @param container_group_name [String] The name of the container group.
608
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
609
+ # will be added to the HTTP request.
610
+ #
611
+ def restart(resource_group_name, container_group_name, custom_headers:nil)
612
+ response = restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
613
+ nil
614
+ end
615
+
616
+ #
617
+ # @param resource_group_name [String] The name of the resource group.
618
+ # @param container_group_name [String] The name of the container group.
619
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
620
+ # will be added to the HTTP request.
621
+ #
622
+ # @return [Concurrent::Promise] promise which provides async access to http
623
+ # response.
624
+ #
625
+ def restart_async(resource_group_name, container_group_name, custom_headers:nil)
626
+ # Send request
627
+ promise = begin_restart_async(resource_group_name, container_group_name, custom_headers:custom_headers)
628
+
629
+ promise = promise.then do |response|
630
+ # Defining deserialization method.
631
+ deserialize_method = lambda do |parsed_response|
632
+ end
633
+
634
+ # Waiting for response.
635
+ @client.get_long_running_operation_result(response, deserialize_method)
636
+ end
637
+
638
+ promise
639
+ end
640
+
641
+ #
642
+ # Stops all containers in a container group.
643
+ #
644
+ # Stops all containers in a container group. Compute resources will be
645
+ # deallocated and billing will stop.
646
+ #
647
+ # @param resource_group_name [String] The name of the resource group.
648
+ # @param container_group_name [String] The name of the container group.
649
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
650
+ # will be added to the HTTP request.
651
+ #
652
+ #
653
+ def stop(resource_group_name, container_group_name, custom_headers:nil)
654
+ response = stop_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
655
+ nil
656
+ end
657
+
658
+ #
659
+ # Stops all containers in a container group.
660
+ #
661
+ # Stops all containers in a container group. Compute resources will be
662
+ # deallocated and billing will stop.
663
+ #
664
+ # @param resource_group_name [String] The name of the resource group.
665
+ # @param container_group_name [String] The name of the container group.
666
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
667
+ # will be added to the HTTP request.
668
+ #
669
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
670
+ #
671
+ def stop_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
672
+ stop_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
673
+ end
674
+
675
+ #
676
+ # Stops all containers in a container group.
677
+ #
678
+ # Stops all containers in a container group. Compute resources will be
679
+ # deallocated and billing will stop.
680
+ #
681
+ # @param resource_group_name [String] The name of the resource group.
682
+ # @param container_group_name [String] The name of the container group.
683
+ # @param [Hash{String => String}] A hash of custom headers that will be added
684
+ # to the HTTP request.
685
+ #
686
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
687
+ #
688
+ def stop_async(resource_group_name, container_group_name, custom_headers:nil)
689
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
690
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
691
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
692
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
693
+
694
+
695
+ request_headers = {}
696
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
697
+
698
+ # Set Headers
699
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
700
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
701
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop'
702
+
703
+ request_url = @base_url || @client.base_url
704
+
705
+ options = {
706
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
707
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
708
+ query_params: {'api-version' => @client.api_version},
709
+ headers: request_headers.merge(custom_headers || {}),
710
+ base_url: request_url
711
+ }
712
+ promise = @client.make_request_async(:post, path_template, options)
713
+
714
+ promise = promise.then do |result|
715
+ http_response = result.response
716
+ status_code = http_response.status
717
+ response_content = http_response.body
718
+ unless status_code == 204
719
+ error_model = JSON.load(response_content)
720
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
721
+ end
722
+
723
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
724
+
725
+ result
726
+ end
727
+
728
+ promise.execute
729
+ end
730
+
731
+ #
732
+ # Create or update container groups.
733
+ #
734
+ # Create or update container groups with specified configurations.
735
+ #
736
+ # @param resource_group_name [String] The name of the resource group.
737
+ # @param container_group_name [String] The name of the container group.
738
+ # @param container_group [ContainerGroup] The properties of the container group
739
+ # to be created or updated.
740
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
741
+ # will be added to the HTTP request.
742
+ #
743
+ # @return [ContainerGroup] operation results.
744
+ #
745
+ def begin_create_or_update(resource_group_name, container_group_name, container_group, custom_headers:nil)
746
+ response = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
747
+ response.body unless response.nil?
748
+ end
749
+
750
+ #
751
+ # Create or update container groups.
752
+ #
753
+ # Create or update container groups with specified configurations.
754
+ #
755
+ # @param resource_group_name [String] The name of the resource group.
756
+ # @param container_group_name [String] The name of the container group.
757
+ # @param container_group [ContainerGroup] The properties of the container group
758
+ # to be created or updated.
759
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
760
+ # will be added to the HTTP request.
761
+ #
762
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
763
+ #
764
+ def begin_create_or_update_with_http_info(resource_group_name, container_group_name, container_group, custom_headers:nil)
765
+ begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
766
+ end
767
+
768
+ #
769
+ # Create or update container groups.
770
+ #
771
+ # Create or update container groups with specified configurations.
772
+ #
773
+ # @param resource_group_name [String] The name of the resource group.
774
+ # @param container_group_name [String] The name of the container group.
775
+ # @param container_group [ContainerGroup] The properties of the container group
776
+ # to be created or updated.
777
+ # @param [Hash{String => String}] A hash of custom headers that will be added
778
+ # to the HTTP request.
779
+ #
780
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
781
+ #
782
+ def begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:nil)
783
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
784
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
785
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
786
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
787
+ fail ArgumentError, 'container_group is nil' if container_group.nil?
788
+
789
+
790
+ request_headers = {}
791
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
792
+
793
+ # Set Headers
794
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
795
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
796
+
797
+ # Serialize Request
798
+ request_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
799
+ request_content = @client.serialize(request_mapper, container_group)
800
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
801
+
802
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
803
+
804
+ request_url = @base_url || @client.base_url
805
+
806
+ options = {
807
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
808
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
809
+ query_params: {'api-version' => @client.api_version},
810
+ body: request_content,
811
+ headers: request_headers.merge(custom_headers || {}),
812
+ base_url: request_url
813
+ }
814
+ promise = @client.make_request_async(:put, path_template, options)
815
+
816
+ promise = promise.then do |result|
817
+ http_response = result.response
818
+ status_code = http_response.status
819
+ response_content = http_response.body
820
+ unless status_code == 200 || status_code == 201
821
+ error_model = JSON.load(response_content)
822
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
823
+ end
824
+
825
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
826
+ # Deserialize Response
827
+ if status_code == 200
828
+ begin
829
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
830
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
831
+ result.body = @client.deserialize(result_mapper, parsed_response)
832
+ rescue Exception => e
833
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
834
+ end
835
+ end
836
+ # Deserialize Response
837
+ if status_code == 201
838
+ begin
839
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
840
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
841
+ result.body = @client.deserialize(result_mapper, parsed_response)
842
+ rescue Exception => e
843
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
844
+ end
845
+ end
846
+
847
+ result
848
+ end
849
+
850
+ promise.execute
851
+ end
852
+
853
+ #
854
+ # Restarts all containers in a container group.
855
+ #
856
+ # Restarts all containers in a container group in place. If container image has
857
+ # updates, new image will be downloaded.
858
+ #
859
+ # @param resource_group_name [String] The name of the resource group.
860
+ # @param container_group_name [String] The name of the container group.
861
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
862
+ # will be added to the HTTP request.
863
+ #
864
+ #
865
+ def begin_restart(resource_group_name, container_group_name, custom_headers:nil)
866
+ response = begin_restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
867
+ nil
868
+ end
869
+
870
+ #
871
+ # Restarts all containers in a container group.
872
+ #
873
+ # Restarts all containers in a container group in place. If container image has
874
+ # updates, new image will be downloaded.
875
+ #
876
+ # @param resource_group_name [String] The name of the resource group.
877
+ # @param container_group_name [String] The name of the container group.
878
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
879
+ # will be added to the HTTP request.
880
+ #
881
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
882
+ #
883
+ def begin_restart_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
884
+ begin_restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
885
+ end
886
+
887
+ #
888
+ # Restarts all containers in a container group.
889
+ #
890
+ # Restarts all containers in a container group in place. If container image has
891
+ # updates, new image will be downloaded.
892
+ #
893
+ # @param resource_group_name [String] The name of the resource group.
894
+ # @param container_group_name [String] The name of the container group.
895
+ # @param [Hash{String => String}] A hash of custom headers that will be added
896
+ # to the HTTP request.
897
+ #
898
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
899
+ #
900
+ def begin_restart_async(resource_group_name, container_group_name, custom_headers:nil)
901
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
902
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
903
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
904
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
905
+
906
+
907
+ request_headers = {}
908
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
909
+
910
+ # Set Headers
911
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
912
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
913
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart'
914
+
915
+ request_url = @base_url || @client.base_url
916
+
917
+ options = {
918
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
919
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
920
+ query_params: {'api-version' => @client.api_version},
921
+ headers: request_headers.merge(custom_headers || {}),
922
+ base_url: request_url
923
+ }
924
+ promise = @client.make_request_async(:post, path_template, options)
925
+
926
+ promise = promise.then do |result|
927
+ http_response = result.response
928
+ status_code = http_response.status
929
+ response_content = http_response.body
930
+ unless status_code == 204
931
+ error_model = JSON.load(response_content)
932
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
933
+ end
934
+
935
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
936
+
937
+ result
938
+ end
939
+
940
+ promise.execute
941
+ end
942
+
943
+ #
944
+ # Get a list of container groups in the specified subscription.
945
+ #
946
+ # Get a list of container groups in the specified subscription. This operation
947
+ # returns properties of each container group including containers, image
948
+ # registry credentials, restart policy, IP address type, OS type, state, and
949
+ # volumes.
950
+ #
951
+ # @param next_page_link [String] The NextLink from the previous successful call
952
+ # to List operation.
953
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
954
+ # will be added to the HTTP request.
955
+ #
956
+ # @return [ContainerGroupListResult] operation results.
957
+ #
958
+ def list_next(next_page_link, custom_headers:nil)
959
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
960
+ response.body unless response.nil?
961
+ end
962
+
963
+ #
964
+ # Get a list of container groups in the specified subscription.
965
+ #
966
+ # Get a list of container groups in the specified subscription. This operation
967
+ # returns properties of each container group including containers, image
968
+ # registry credentials, restart policy, IP address type, OS type, state, and
969
+ # volumes.
970
+ #
971
+ # @param next_page_link [String] The NextLink from the previous successful call
972
+ # to List operation.
973
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
974
+ # will be added to the HTTP request.
975
+ #
976
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
977
+ #
978
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
979
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
980
+ end
981
+
982
+ #
983
+ # Get a list of container groups in the specified subscription.
984
+ #
985
+ # Get a list of container groups in the specified subscription. This operation
986
+ # returns properties of each container group including containers, image
987
+ # registry credentials, restart policy, IP address type, OS type, state, and
988
+ # volumes.
989
+ #
990
+ # @param next_page_link [String] The NextLink from the previous successful call
991
+ # to List operation.
992
+ # @param [Hash{String => String}] A hash of custom headers that will be added
993
+ # to the HTTP request.
994
+ #
995
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
996
+ #
997
+ def list_next_async(next_page_link, custom_headers:nil)
998
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
999
+
1000
+
1001
+ request_headers = {}
1002
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1003
+
1004
+ # Set Headers
1005
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1006
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1007
+ path_template = '{nextLink}'
1008
+
1009
+ request_url = @base_url || @client.base_url
1010
+
1011
+ options = {
1012
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1013
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1014
+ headers: request_headers.merge(custom_headers || {}),
1015
+ base_url: request_url
1016
+ }
1017
+ promise = @client.make_request_async(:get, path_template, options)
1018
+
1019
+ promise = promise.then do |result|
1020
+ http_response = result.response
1021
+ status_code = http_response.status
1022
+ response_content = http_response.body
1023
+ unless status_code == 200
1024
+ error_model = JSON.load(response_content)
1025
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1026
+ end
1027
+
1028
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1029
+ # Deserialize Response
1030
+ if status_code == 200
1031
+ begin
1032
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1033
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroupListResult.mapper()
1034
+ result.body = @client.deserialize(result_mapper, parsed_response)
1035
+ rescue Exception => e
1036
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1037
+ end
1038
+ end
1039
+
1040
+ result
1041
+ end
1042
+
1043
+ promise.execute
1044
+ end
1045
+
1046
+ #
1047
+ # Get a list of container groups in the specified subscription and resource
1048
+ # group.
1049
+ #
1050
+ # Get a list of container groups in a specified subscription and resource
1051
+ # group. This operation returns properties of each container group including
1052
+ # containers, image registry credentials, restart policy, IP address type, OS
1053
+ # type, state, and volumes.
1054
+ #
1055
+ # @param next_page_link [String] The NextLink from the previous successful call
1056
+ # to List operation.
1057
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1058
+ # will be added to the HTTP request.
1059
+ #
1060
+ # @return [ContainerGroupListResult] operation results.
1061
+ #
1062
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1063
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1064
+ response.body unless response.nil?
1065
+ end
1066
+
1067
+ #
1068
+ # Get a list of container groups in the specified subscription and resource
1069
+ # group.
1070
+ #
1071
+ # Get a list of container groups in a specified subscription and resource
1072
+ # group. This operation returns properties of each container group including
1073
+ # containers, image registry credentials, restart policy, IP address type, OS
1074
+ # type, state, and volumes.
1075
+ #
1076
+ # @param next_page_link [String] The NextLink from the previous successful call
1077
+ # to List operation.
1078
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1079
+ # will be added to the HTTP request.
1080
+ #
1081
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1082
+ #
1083
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1084
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1085
+ end
1086
+
1087
+ #
1088
+ # Get a list of container groups in the specified subscription and resource
1089
+ # group.
1090
+ #
1091
+ # Get a list of container groups in a specified subscription and resource
1092
+ # group. This operation returns properties of each container group including
1093
+ # containers, image registry credentials, restart policy, IP address type, OS
1094
+ # type, state, and volumes.
1095
+ #
1096
+ # @param next_page_link [String] The NextLink from the previous successful call
1097
+ # to List operation.
1098
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1099
+ # to the HTTP request.
1100
+ #
1101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1102
+ #
1103
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1104
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1105
+
1106
+
1107
+ request_headers = {}
1108
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1109
+
1110
+ # Set Headers
1111
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1112
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1113
+ path_template = '{nextLink}'
1114
+
1115
+ request_url = @base_url || @client.base_url
1116
+
1117
+ options = {
1118
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1119
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1120
+ headers: request_headers.merge(custom_headers || {}),
1121
+ base_url: request_url
1122
+ }
1123
+ promise = @client.make_request_async(:get, path_template, options)
1124
+
1125
+ promise = promise.then do |result|
1126
+ http_response = result.response
1127
+ status_code = http_response.status
1128
+ response_content = http_response.body
1129
+ unless status_code == 200
1130
+ error_model = JSON.load(response_content)
1131
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1132
+ end
1133
+
1134
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1135
+ # Deserialize Response
1136
+ if status_code == 200
1137
+ begin
1138
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1139
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroupListResult.mapper()
1140
+ result.body = @client.deserialize(result_mapper, parsed_response)
1141
+ rescue Exception => e
1142
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1143
+ end
1144
+ end
1145
+
1146
+ result
1147
+ end
1148
+
1149
+ promise.execute
1150
+ end
1151
+
1152
+ #
1153
+ # Get a list of container groups in the specified subscription.
1154
+ #
1155
+ # Get a list of container groups in the specified subscription. This operation
1156
+ # returns properties of each container group including containers, image
1157
+ # registry credentials, restart policy, IP address type, OS type, state, and
1158
+ # volumes.
1159
+ #
1160
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1161
+ # will be added to the HTTP request.
1162
+ #
1163
+ # @return [ContainerGroupListResult] which provide lazy access to pages of the
1164
+ # response.
1165
+ #
1166
+ def list_as_lazy(custom_headers:nil)
1167
+ response = list_async(custom_headers:custom_headers).value!
1168
+ unless response.nil?
1169
+ page = response.body
1170
+ page.next_method = Proc.new do |next_page_link|
1171
+ list_next_async(next_page_link, custom_headers:custom_headers)
1172
+ end
1173
+ page
1174
+ end
1175
+ end
1176
+
1177
+ #
1178
+ # Get a list of container groups in the specified subscription and resource
1179
+ # group.
1180
+ #
1181
+ # Get a list of container groups in a specified subscription and resource
1182
+ # group. This operation returns properties of each container group including
1183
+ # containers, image registry credentials, restart policy, IP address type, OS
1184
+ # type, state, and volumes.
1185
+ #
1186
+ # @param resource_group_name [String] The name of the resource group.
1187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1188
+ # will be added to the HTTP request.
1189
+ #
1190
+ # @return [ContainerGroupListResult] which provide lazy access to pages of the
1191
+ # response.
1192
+ #
1193
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1194
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1195
+ unless response.nil?
1196
+ page = response.body
1197
+ page.next_method = Proc.new do |next_page_link|
1198
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1199
+ end
1200
+ page
1201
+ end
1202
+ end
1203
+
1204
+ end
1205
+ end