azure_mgmt_container_instance 0.17.0 → 0.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,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,1332 @@
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
+ # Starts all containers in a container group.
733
+ #
734
+ # Starts all containers in a container group.
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 custom_headers [Hash{String => String}] A hash of custom headers that
739
+ # will be added to the HTTP request.
740
+ #
741
+ def start(resource_group_name, container_group_name, custom_headers:nil)
742
+ response = start_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
743
+ nil
744
+ end
745
+
746
+ #
747
+ # @param resource_group_name [String] The name of the resource group.
748
+ # @param container_group_name [String] The name of the container group.
749
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
750
+ # will be added to the HTTP request.
751
+ #
752
+ # @return [Concurrent::Promise] promise which provides async access to http
753
+ # response.
754
+ #
755
+ def start_async(resource_group_name, container_group_name, custom_headers:nil)
756
+ # Send request
757
+ promise = begin_start_async(resource_group_name, container_group_name, custom_headers:custom_headers)
758
+
759
+ promise = promise.then do |response|
760
+ # Defining deserialization method.
761
+ deserialize_method = lambda do |parsed_response|
762
+ end
763
+
764
+ # Waiting for response.
765
+ @client.get_long_running_operation_result(response, deserialize_method)
766
+ end
767
+
768
+ promise
769
+ end
770
+
771
+ #
772
+ # Create or update container groups.
773
+ #
774
+ # Create or update container groups with specified configurations.
775
+ #
776
+ # @param resource_group_name [String] The name of the resource group.
777
+ # @param container_group_name [String] The name of the container group.
778
+ # @param container_group [ContainerGroup] The properties of the container group
779
+ # to be created or updated.
780
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
781
+ # will be added to the HTTP request.
782
+ #
783
+ # @return [ContainerGroup] operation results.
784
+ #
785
+ def begin_create_or_update(resource_group_name, container_group_name, container_group, custom_headers:nil)
786
+ response = begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
787
+ response.body unless response.nil?
788
+ end
789
+
790
+ #
791
+ # Create or update container groups.
792
+ #
793
+ # Create or update container groups with specified configurations.
794
+ #
795
+ # @param resource_group_name [String] The name of the resource group.
796
+ # @param container_group_name [String] The name of the container group.
797
+ # @param container_group [ContainerGroup] The properties of the container group
798
+ # to be created or updated.
799
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
800
+ # will be added to the HTTP request.
801
+ #
802
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
803
+ #
804
+ def begin_create_or_update_with_http_info(resource_group_name, container_group_name, container_group, custom_headers:nil)
805
+ begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
806
+ end
807
+
808
+ #
809
+ # Create or update container groups.
810
+ #
811
+ # Create or update container groups with specified configurations.
812
+ #
813
+ # @param resource_group_name [String] The name of the resource group.
814
+ # @param container_group_name [String] The name of the container group.
815
+ # @param container_group [ContainerGroup] The properties of the container group
816
+ # to be created or updated.
817
+ # @param [Hash{String => String}] A hash of custom headers that will be added
818
+ # to the HTTP request.
819
+ #
820
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
821
+ #
822
+ def begin_create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:nil)
823
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
824
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
825
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
826
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
827
+ fail ArgumentError, 'container_group is nil' if container_group.nil?
828
+
829
+
830
+ request_headers = {}
831
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
832
+
833
+ # Set Headers
834
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
835
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
836
+
837
+ # Serialize Request
838
+ request_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
839
+ request_content = @client.serialize(request_mapper, container_group)
840
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
841
+
842
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
843
+
844
+ request_url = @base_url || @client.base_url
845
+
846
+ options = {
847
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
848
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
849
+ query_params: {'api-version' => @client.api_version},
850
+ body: request_content,
851
+ headers: request_headers.merge(custom_headers || {}),
852
+ base_url: request_url
853
+ }
854
+ promise = @client.make_request_async(:put, path_template, options)
855
+
856
+ promise = promise.then do |result|
857
+ http_response = result.response
858
+ status_code = http_response.status
859
+ response_content = http_response.body
860
+ unless status_code == 200 || status_code == 201
861
+ error_model = JSON.load(response_content)
862
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
863
+ end
864
+
865
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
866
+ # Deserialize Response
867
+ if status_code == 200
868
+ begin
869
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
870
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
871
+ result.body = @client.deserialize(result_mapper, parsed_response)
872
+ rescue Exception => e
873
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
874
+ end
875
+ end
876
+ # Deserialize Response
877
+ if status_code == 201
878
+ begin
879
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
880
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroup.mapper()
881
+ result.body = @client.deserialize(result_mapper, parsed_response)
882
+ rescue Exception => e
883
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
884
+ end
885
+ end
886
+
887
+ result
888
+ end
889
+
890
+ promise.execute
891
+ end
892
+
893
+ #
894
+ # Restarts all containers in a container group.
895
+ #
896
+ # Restarts all containers in a container group in place. If container image has
897
+ # updates, new image will be downloaded.
898
+ #
899
+ # @param resource_group_name [String] The name of the resource group.
900
+ # @param container_group_name [String] The name of the container group.
901
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
902
+ # will be added to the HTTP request.
903
+ #
904
+ #
905
+ def begin_restart(resource_group_name, container_group_name, custom_headers:nil)
906
+ response = begin_restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
907
+ nil
908
+ end
909
+
910
+ #
911
+ # Restarts all containers in a container group.
912
+ #
913
+ # Restarts all containers in a container group in place. If container image has
914
+ # updates, new image will be downloaded.
915
+ #
916
+ # @param resource_group_name [String] The name of the resource group.
917
+ # @param container_group_name [String] The name of the container group.
918
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
919
+ # will be added to the HTTP request.
920
+ #
921
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
922
+ #
923
+ def begin_restart_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
924
+ begin_restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
925
+ end
926
+
927
+ #
928
+ # Restarts all containers in a container group.
929
+ #
930
+ # Restarts all containers in a container group in place. If container image has
931
+ # updates, new image will be downloaded.
932
+ #
933
+ # @param resource_group_name [String] The name of the resource group.
934
+ # @param container_group_name [String] The name of the container group.
935
+ # @param [Hash{String => String}] A hash of custom headers that will be added
936
+ # to the HTTP request.
937
+ #
938
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
939
+ #
940
+ def begin_restart_async(resource_group_name, container_group_name, custom_headers:nil)
941
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
942
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
943
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
944
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
945
+
946
+
947
+ request_headers = {}
948
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
949
+
950
+ # Set Headers
951
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
952
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
953
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart'
954
+
955
+ request_url = @base_url || @client.base_url
956
+
957
+ options = {
958
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
959
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
960
+ query_params: {'api-version' => @client.api_version},
961
+ headers: request_headers.merge(custom_headers || {}),
962
+ base_url: request_url
963
+ }
964
+ promise = @client.make_request_async(:post, path_template, options)
965
+
966
+ promise = promise.then do |result|
967
+ http_response = result.response
968
+ status_code = http_response.status
969
+ response_content = http_response.body
970
+ unless status_code == 204
971
+ error_model = JSON.load(response_content)
972
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
973
+ end
974
+
975
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
976
+
977
+ result
978
+ end
979
+
980
+ promise.execute
981
+ end
982
+
983
+ #
984
+ # Starts all containers in a container group.
985
+ #
986
+ # Starts all containers in a container group.
987
+ #
988
+ # @param resource_group_name [String] The name of the resource group.
989
+ # @param container_group_name [String] The name of the container group.
990
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
991
+ # will be added to the HTTP request.
992
+ #
993
+ #
994
+ def begin_start(resource_group_name, container_group_name, custom_headers:nil)
995
+ response = begin_start_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
996
+ nil
997
+ end
998
+
999
+ #
1000
+ # Starts all containers in a container group.
1001
+ #
1002
+ # Starts all containers in a container group.
1003
+ #
1004
+ # @param resource_group_name [String] The name of the resource group.
1005
+ # @param container_group_name [String] The name of the container group.
1006
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1007
+ # will be added to the HTTP request.
1008
+ #
1009
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1010
+ #
1011
+ def begin_start_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
1012
+ begin_start_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
1013
+ end
1014
+
1015
+ #
1016
+ # Starts all containers in a container group.
1017
+ #
1018
+ # Starts all containers in a container group.
1019
+ #
1020
+ # @param resource_group_name [String] The name of the resource group.
1021
+ # @param container_group_name [String] The name of the container group.
1022
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1023
+ # to the HTTP request.
1024
+ #
1025
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1026
+ #
1027
+ def begin_start_async(resource_group_name, container_group_name, custom_headers:nil)
1028
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1029
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1030
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1031
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
1032
+
1033
+
1034
+ request_headers = {}
1035
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1036
+
1037
+ # Set Headers
1038
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1039
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1040
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start'
1041
+
1042
+ request_url = @base_url || @client.base_url
1043
+
1044
+ options = {
1045
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1046
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
1047
+ query_params: {'api-version' => @client.api_version},
1048
+ headers: request_headers.merge(custom_headers || {}),
1049
+ base_url: request_url
1050
+ }
1051
+ promise = @client.make_request_async(:post, path_template, options)
1052
+
1053
+ promise = promise.then do |result|
1054
+ http_response = result.response
1055
+ status_code = http_response.status
1056
+ response_content = http_response.body
1057
+ unless status_code == 204
1058
+ error_model = JSON.load(response_content)
1059
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1060
+ end
1061
+
1062
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1063
+
1064
+ result
1065
+ end
1066
+
1067
+ promise.execute
1068
+ end
1069
+
1070
+ #
1071
+ # Get a list of container groups in the specified subscription.
1072
+ #
1073
+ # Get a list of container groups in the specified subscription. This operation
1074
+ # returns properties of each container group including containers, image
1075
+ # registry credentials, restart policy, IP address type, OS type, state, and
1076
+ # volumes.
1077
+ #
1078
+ # @param next_page_link [String] The NextLink from the previous successful call
1079
+ # to List operation.
1080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1081
+ # will be added to the HTTP request.
1082
+ #
1083
+ # @return [ContainerGroupListResult] operation results.
1084
+ #
1085
+ def list_next(next_page_link, custom_headers:nil)
1086
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1087
+ response.body unless response.nil?
1088
+ end
1089
+
1090
+ #
1091
+ # Get a list of container groups in the specified subscription.
1092
+ #
1093
+ # Get a list of container groups in the specified subscription. This operation
1094
+ # returns properties of each container group including containers, image
1095
+ # registry credentials, restart policy, IP address type, OS type, state, and
1096
+ # volumes.
1097
+ #
1098
+ # @param next_page_link [String] The NextLink from the previous successful call
1099
+ # to List operation.
1100
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1101
+ # will be added to the HTTP request.
1102
+ #
1103
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1104
+ #
1105
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1106
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1107
+ end
1108
+
1109
+ #
1110
+ # Get a list of container groups in the specified subscription.
1111
+ #
1112
+ # Get a list of container groups in the specified subscription. This operation
1113
+ # returns properties of each container group including containers, image
1114
+ # registry credentials, restart policy, IP address type, OS type, state, and
1115
+ # volumes.
1116
+ #
1117
+ # @param next_page_link [String] The NextLink from the previous successful call
1118
+ # to List operation.
1119
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1120
+ # to the HTTP request.
1121
+ #
1122
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1123
+ #
1124
+ def list_next_async(next_page_link, custom_headers:nil)
1125
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1126
+
1127
+
1128
+ request_headers = {}
1129
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1130
+
1131
+ # Set Headers
1132
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1133
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1134
+ path_template = '{nextLink}'
1135
+
1136
+ request_url = @base_url || @client.base_url
1137
+
1138
+ options = {
1139
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1140
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1141
+ headers: request_headers.merge(custom_headers || {}),
1142
+ base_url: request_url
1143
+ }
1144
+ promise = @client.make_request_async(:get, path_template, options)
1145
+
1146
+ promise = promise.then do |result|
1147
+ http_response = result.response
1148
+ status_code = http_response.status
1149
+ response_content = http_response.body
1150
+ unless status_code == 200
1151
+ error_model = JSON.load(response_content)
1152
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1153
+ end
1154
+
1155
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1156
+ # Deserialize Response
1157
+ if status_code == 200
1158
+ begin
1159
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1160
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroupListResult.mapper()
1161
+ result.body = @client.deserialize(result_mapper, parsed_response)
1162
+ rescue Exception => e
1163
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1164
+ end
1165
+ end
1166
+
1167
+ result
1168
+ end
1169
+
1170
+ promise.execute
1171
+ end
1172
+
1173
+ #
1174
+ # Get a list of container groups in the specified subscription and resource
1175
+ # group.
1176
+ #
1177
+ # Get a list of container groups in a specified subscription and resource
1178
+ # group. This operation returns properties of each container group including
1179
+ # containers, image registry credentials, restart policy, IP address type, OS
1180
+ # type, state, and volumes.
1181
+ #
1182
+ # @param next_page_link [String] The NextLink from the previous successful call
1183
+ # to List operation.
1184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1185
+ # will be added to the HTTP request.
1186
+ #
1187
+ # @return [ContainerGroupListResult] operation results.
1188
+ #
1189
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1190
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1191
+ response.body unless response.nil?
1192
+ end
1193
+
1194
+ #
1195
+ # Get a list of container groups in the specified subscription and resource
1196
+ # group.
1197
+ #
1198
+ # Get a list of container groups in a specified subscription and resource
1199
+ # group. This operation returns properties of each container group including
1200
+ # containers, image registry credentials, restart policy, IP address type, OS
1201
+ # type, state, and volumes.
1202
+ #
1203
+ # @param next_page_link [String] The NextLink from the previous successful call
1204
+ # to List operation.
1205
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1206
+ # will be added to the HTTP request.
1207
+ #
1208
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1209
+ #
1210
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1211
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1212
+ end
1213
+
1214
+ #
1215
+ # Get a list of container groups in the specified subscription and resource
1216
+ # group.
1217
+ #
1218
+ # Get a list of container groups in a specified subscription and resource
1219
+ # group. This operation returns properties of each container group including
1220
+ # containers, image registry credentials, restart policy, IP address type, OS
1221
+ # type, state, and volumes.
1222
+ #
1223
+ # @param next_page_link [String] The NextLink from the previous successful call
1224
+ # to List operation.
1225
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1226
+ # to the HTTP request.
1227
+ #
1228
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1229
+ #
1230
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1231
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1232
+
1233
+
1234
+ request_headers = {}
1235
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1236
+
1237
+ # Set Headers
1238
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1239
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1240
+ path_template = '{nextLink}'
1241
+
1242
+ request_url = @base_url || @client.base_url
1243
+
1244
+ options = {
1245
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1246
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1247
+ headers: request_headers.merge(custom_headers || {}),
1248
+ base_url: request_url
1249
+ }
1250
+ promise = @client.make_request_async(:get, path_template, options)
1251
+
1252
+ promise = promise.then do |result|
1253
+ http_response = result.response
1254
+ status_code = http_response.status
1255
+ response_content = http_response.body
1256
+ unless status_code == 200
1257
+ error_model = JSON.load(response_content)
1258
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1259
+ end
1260
+
1261
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1262
+ # Deserialize Response
1263
+ if status_code == 200
1264
+ begin
1265
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1266
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_10_01::Models::ContainerGroupListResult.mapper()
1267
+ result.body = @client.deserialize(result_mapper, parsed_response)
1268
+ rescue Exception => e
1269
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1270
+ end
1271
+ end
1272
+
1273
+ result
1274
+ end
1275
+
1276
+ promise.execute
1277
+ end
1278
+
1279
+ #
1280
+ # Get a list of container groups in the specified subscription.
1281
+ #
1282
+ # Get a list of container groups in the specified subscription. This operation
1283
+ # returns properties of each container group including containers, image
1284
+ # registry credentials, restart policy, IP address type, OS type, state, and
1285
+ # volumes.
1286
+ #
1287
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1288
+ # will be added to the HTTP request.
1289
+ #
1290
+ # @return [ContainerGroupListResult] which provide lazy access to pages of the
1291
+ # response.
1292
+ #
1293
+ def list_as_lazy(custom_headers:nil)
1294
+ response = list_async(custom_headers:custom_headers).value!
1295
+ unless response.nil?
1296
+ page = response.body
1297
+ page.next_method = Proc.new do |next_page_link|
1298
+ list_next_async(next_page_link, custom_headers:custom_headers)
1299
+ end
1300
+ page
1301
+ end
1302
+ end
1303
+
1304
+ #
1305
+ # Get a list of container groups in the specified subscription and resource
1306
+ # group.
1307
+ #
1308
+ # Get a list of container groups in a specified subscription and resource
1309
+ # group. This operation returns properties of each container group including
1310
+ # containers, image registry credentials, restart policy, IP address type, OS
1311
+ # type, state, and volumes.
1312
+ #
1313
+ # @param resource_group_name [String] The name of the resource group.
1314
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1315
+ # will be added to the HTTP request.
1316
+ #
1317
+ # @return [ContainerGroupListResult] which provide lazy access to pages of the
1318
+ # response.
1319
+ #
1320
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1321
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1322
+ unless response.nil?
1323
+ page = response.body
1324
+ page.next_method = Proc.new do |next_page_link|
1325
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1326
+ end
1327
+ page
1328
+ end
1329
+ end
1330
+
1331
+ end
1332
+ end