azure_mgmt_databoxedge 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-08-01/generated/azure_mgmt_databoxedge.rb +158 -0
  4. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/alerts.rb +328 -0
  5. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/bandwidth_schedules.rb +621 -0
  6. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/containers.rb +771 -0
  7. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/data_box_edge_management_client.rb +191 -0
  8. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/devices.rb +1811 -0
  9. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/jobs.rb +126 -0
  10. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/account_type.rb +16 -0
  11. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/address.rb +112 -0
  12. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert.rb +156 -0
  13. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert_error_details.rb +71 -0
  14. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert_list.rb +100 -0
  15. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert_severity.rb +17 -0
  16. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/armbase_model.rb +71 -0
  17. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/asymmetric_encrypted_secret.rb +70 -0
  18. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/authentication.rb +47 -0
  19. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/authentication_type.rb +16 -0
  20. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/azure_container_data_format.rb +17 -0
  21. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/azure_container_info.rb +72 -0
  22. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/bandwidth_schedule.rb +115 -0
  23. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/bandwidth_schedules_list.rb +100 -0
  24. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/client_access_right.rb +59 -0
  25. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/client_permission_type.rb +17 -0
  26. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/contact_details.rb +87 -0
  27. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/container.rb +113 -0
  28. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/container_list.rb +100 -0
  29. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/container_status.rb +19 -0
  30. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device.rb +300 -0
  31. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_extended_info.rb +97 -0
  32. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_list.rb +101 -0
  33. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_patch.rb +55 -0
  34. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_status.rb +21 -0
  35. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_policy.rb +16 -0
  36. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/day_of_week.rb +21 -0
  37. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/device_type.rb +15 -0
  38. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/download_phase.rb +18 -0
  39. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/encryption_algorithm.rb +17 -0
  40. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/file_event_trigger.rb +115 -0
  41. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/file_source_info.rb +46 -0
  42. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/install_reboot_behavior.rb +17 -0
  43. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/io_tdevice_info.rb +80 -0
  44. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/io_trole.rb +147 -0
  45. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/ipv4config.rb +71 -0
  46. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/ipv6config.rb +71 -0
  47. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job.rb +242 -0
  48. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_error_details.rb +80 -0
  49. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_error_item.rb +79 -0
  50. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_status.rb +21 -0
  51. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_type.rb +20 -0
  52. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_aggregation_type.rb +21 -0
  53. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_category.rb +16 -0
  54. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_dimension_v1.rb +68 -0
  55. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_specification_v1.rb +187 -0
  56. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_unit.rb +22 -0
  57. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/monitoring_status.rb +16 -0
  58. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/mount_point_map.rb +83 -0
  59. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter.rb +229 -0
  60. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_dhcpstatus.rb +16 -0
  61. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_position.rb +60 -0
  62. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_rdmastatus.rb +16 -0
  63. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_status.rb +16 -0
  64. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_group.rb +17 -0
  65. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_settings.rb +83 -0
  66. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/node.rb +152 -0
  67. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/node_list.rb +56 -0
  68. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/node_status.rb +19 -0
  69. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/operation.rb +81 -0
  70. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/operation_display.rb +80 -0
  71. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/operations_list.rb +99 -0
  72. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order.rb +177 -0
  73. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order_list.rb +100 -0
  74. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order_state.rb +28 -0
  75. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order_status.rb +96 -0
  76. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/periodic_timer_event_trigger.rb +115 -0
  77. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/periodic_timer_source_info.rb +73 -0
  78. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/platform_type.rb +16 -0
  79. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/refresh_details.rb +87 -0
  80. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/resource_type_sku.rb +202 -0
  81. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role.rb +71 -0
  82. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_list.rb +102 -0
  83. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_sink_info.rb +46 -0
  84. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_status.rb +16 -0
  85. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_types.rb +18 -0
  86. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/security_settings.rb +78 -0
  87. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/service_specification.rb +56 -0
  88. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share.rb +208 -0
  89. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_access_protocol.rb +16 -0
  90. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_access_right.rb +59 -0
  91. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_access_type.rb +17 -0
  92. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_list.rb +100 -0
  93. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_status.rb +19 -0
  94. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku.rb +61 -0
  95. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_cost.rb +71 -0
  96. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_information_list.rb +68 -0
  97. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_location_info.rb +87 -0
  98. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_name.rb +23 -0
  99. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_restriction.rb +94 -0
  100. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_restriction_info.rb +75 -0
  101. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_restriction_reason_code.rb +16 -0
  102. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_tier.rb +15 -0
  103. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sslstatus.rb +16 -0
  104. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account.rb +134 -0
  105. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_credential.rb +154 -0
  106. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_credential_list.rb +100 -0
  107. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_list.rb +101 -0
  108. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_status.rb +19 -0
  109. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/symmetric_key.rb +48 -0
  110. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/time_grain.rb +22 -0
  111. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/tracking_info.rb +79 -0
  112. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/trigger.rb +71 -0
  113. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/trigger_list.rb +102 -0
  114. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_download_progress.rb +108 -0
  115. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_install_progress.rb +71 -0
  116. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_operation.rb +18 -0
  117. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_operation_stage.rb +31 -0
  118. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_summary.rb +281 -0
  119. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/upload_certificate_request.rb +58 -0
  120. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/upload_certificate_response.rb +132 -0
  121. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user.rb +108 -0
  122. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user_access_right.rb +59 -0
  123. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user_list.rb +100 -0
  124. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user_type.rb +17 -0
  125. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/module_definition.rb +9 -0
  126. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/nodes.rb +119 -0
  127. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/operations.rb +218 -0
  128. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/operations_status.rb +126 -0
  129. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/orders.rb +594 -0
  130. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/roles.rb +610 -0
  131. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/shares.rb +737 -0
  132. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/skus.rb +117 -0
  133. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/storage_account_credentials.rb +623 -0
  134. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/storage_accounts.rb +615 -0
  135. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/triggers.rb +618 -0
  136. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/users.rb +622 -0
  137. data/lib/azure_mgmt_databoxedge.rb +6 -0
  138. data/lib/module_definition.rb +7 -0
  139. data/lib/profiles/latest/databoxedge_latest_profile_client.rb +40 -0
  140. data/lib/profiles/latest/databoxedge_module_definition.rb +8 -0
  141. data/lib/profiles/latest/modules/databoxedge_profile_module.rb +551 -0
  142. data/lib/version.rb +7 -0
  143. metadata +258 -0
@@ -0,0 +1,771 @@
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::DataBoxEdge::Mgmt::V2019_08_01
7
+ #
8
+ # Containers
9
+ #
10
+ class Containers
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Containers class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DataBoxEdgeManagementClient] reference to the DataBoxEdgeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
26
+ # Gateway device.
27
+ #
28
+ # @param device_name [String] The device name.
29
+ # @param storage_account_name [String] The storage Account name.
30
+ # @param resource_group_name [String] The resource group name.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<Container>] operation results.
35
+ #
36
+ def list_by_storage_account(device_name, storage_account_name, resource_group_name, custom_headers:nil)
37
+ first_page = list_by_storage_account_as_lazy(device_name, storage_account_name, resource_group_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
43
+ # Gateway device.
44
+ #
45
+ # @param device_name [String] The device name.
46
+ # @param storage_account_name [String] The storage Account name.
47
+ # @param resource_group_name [String] The resource group name.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_by_storage_account_with_http_info(device_name, storage_account_name, resource_group_name, custom_headers:nil)
54
+ list_by_storage_account_async(device_name, storage_account_name, resource_group_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
59
+ # Gateway device.
60
+ #
61
+ # @param device_name [String] The device name.
62
+ # @param storage_account_name [String] The storage Account name.
63
+ # @param resource_group_name [String] The resource group name.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_by_storage_account_async(device_name, storage_account_name, resource_group_name, custom_headers:nil)
70
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
71
+ fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil?
72
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
73
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers'
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: {'deviceName' => device_name,'storageAccountName' => storage_account_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
107
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::ContainerList.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Gets a container by name.
127
+ #
128
+ # @param device_name [String] The device name.
129
+ # @param storage_account_name [String] The Storage Account Name
130
+ # @param container_name [String] The container Name
131
+ # @param resource_group_name [String] The resource group name.
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [Container] operation results.
136
+ #
137
+ def get(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
138
+ response = get_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # Gets a container by name.
144
+ #
145
+ # @param device_name [String] The device name.
146
+ # @param storage_account_name [String] The Storage Account Name
147
+ # @param container_name [String] The container Name
148
+ # @param resource_group_name [String] The resource group name.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
153
+ #
154
+ def get_with_http_info(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
155
+ get_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
156
+ end
157
+
158
+ #
159
+ # Gets a container by name.
160
+ #
161
+ # @param device_name [String] The device name.
162
+ # @param storage_account_name [String] The Storage Account Name
163
+ # @param container_name [String] The container Name
164
+ # @param resource_group_name [String] The resource group name.
165
+ # @param [Hash{String => String}] A hash of custom headers that will be added
166
+ # to the HTTP request.
167
+ #
168
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
169
+ #
170
+ def get_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
171
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
172
+ fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil?
173
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
174
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
175
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
176
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
177
+
178
+
179
+ request_headers = {}
180
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
181
+
182
+ # Set Headers
183
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
184
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
185
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
+ options = {
190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
+ path_params: {'deviceName' => device_name,'storageAccountName' => storage_account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
192
+ query_params: {'api-version' => @client.api_version},
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
+ }
196
+ promise = @client.make_request_async(:get, path_template, options)
197
+
198
+ promise = promise.then do |result|
199
+ http_response = result.response
200
+ status_code = http_response.status
201
+ response_content = http_response.body
202
+ unless status_code == 200
203
+ error_model = JSON.load(response_content)
204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
205
+ end
206
+
207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
209
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
210
+ # Deserialize Response
211
+ if status_code == 200
212
+ begin
213
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
214
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Container.mapper()
215
+ result.body = @client.deserialize(result_mapper, parsed_response)
216
+ rescue Exception => e
217
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
218
+ end
219
+ end
220
+
221
+ result
222
+ end
223
+
224
+ promise.execute
225
+ end
226
+
227
+ #
228
+ # Creates a new container or updates an existing container on the device.
229
+ #
230
+ # @param device_name [String] The device name.
231
+ # @param storage_account_name [String] The Storage Account Name
232
+ # @param container_name [String] The container name.
233
+ # @param container [Container] The container properties.
234
+ # @param resource_group_name [String] The resource group name.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [Container] operation results.
239
+ #
240
+ def create_or_update(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:nil)
241
+ response = create_or_update_async(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:custom_headers).value!
242
+ response.body unless response.nil?
243
+ end
244
+
245
+ #
246
+ # @param device_name [String] The device name.
247
+ # @param storage_account_name [String] The Storage Account Name
248
+ # @param container_name [String] The container name.
249
+ # @param container [Container] The container properties.
250
+ # @param resource_group_name [String] The resource group name.
251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
252
+ # will be added to the HTTP request.
253
+ #
254
+ # @return [Concurrent::Promise] promise which provides async access to http
255
+ # response.
256
+ #
257
+ def create_or_update_async(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:nil)
258
+ # Send request
259
+ promise = begin_create_or_update_async(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:custom_headers)
260
+
261
+ promise = promise.then do |response|
262
+ # Defining deserialization method.
263
+ deserialize_method = lambda do |parsed_response|
264
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Container.mapper()
265
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
266
+ end
267
+
268
+ # Waiting for response.
269
+ @client.get_long_running_operation_result(response, deserialize_method)
270
+ end
271
+
272
+ promise
273
+ end
274
+
275
+ #
276
+ # Deletes the container on the Data Box Edge/Data Box Gateway device.
277
+ #
278
+ # @param device_name [String] The device name.
279
+ # @param storage_account_name [String] The Storage Account Name
280
+ # @param container_name [String] The container name.
281
+ # @param resource_group_name [String] The resource group name.
282
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
283
+ # will be added to the HTTP request.
284
+ #
285
+ def delete(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
286
+ response = delete_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
287
+ nil
288
+ end
289
+
290
+ #
291
+ # @param device_name [String] The device name.
292
+ # @param storage_account_name [String] The Storage Account Name
293
+ # @param container_name [String] The container name.
294
+ # @param resource_group_name [String] The resource group name.
295
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
296
+ # will be added to the HTTP request.
297
+ #
298
+ # @return [Concurrent::Promise] promise which provides async access to http
299
+ # response.
300
+ #
301
+ def delete_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
302
+ # Send request
303
+ promise = begin_delete_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers)
304
+
305
+ promise = promise.then do |response|
306
+ # Defining deserialization method.
307
+ deserialize_method = lambda do |parsed_response|
308
+ end
309
+
310
+ # Waiting for response.
311
+ @client.get_long_running_operation_result(response, deserialize_method)
312
+ end
313
+
314
+ promise
315
+ end
316
+
317
+ #
318
+ # Refreshes the container metadata with the data from the cloud.
319
+ #
320
+ # @param device_name [String] The device name.
321
+ # @param storage_account_name [String] The Storage Account Name
322
+ # @param container_name [String] The container name.
323
+ # @param resource_group_name [String] The resource group name.
324
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
325
+ # will be added to the HTTP request.
326
+ #
327
+ def refresh(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
328
+ response = refresh_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
329
+ nil
330
+ end
331
+
332
+ #
333
+ # @param device_name [String] The device name.
334
+ # @param storage_account_name [String] The Storage Account Name
335
+ # @param container_name [String] The container name.
336
+ # @param resource_group_name [String] The resource group name.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [Concurrent::Promise] promise which provides async access to http
341
+ # response.
342
+ #
343
+ def refresh_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
344
+ # Send request
345
+ promise = begin_refresh_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers)
346
+
347
+ promise = promise.then do |response|
348
+ # Defining deserialization method.
349
+ deserialize_method = lambda do |parsed_response|
350
+ end
351
+
352
+ # Waiting for response.
353
+ @client.get_long_running_operation_result(response, deserialize_method)
354
+ end
355
+
356
+ promise
357
+ end
358
+
359
+ #
360
+ # Creates a new container or updates an existing container on the device.
361
+ #
362
+ # @param device_name [String] The device name.
363
+ # @param storage_account_name [String] The Storage Account Name
364
+ # @param container_name [String] The container name.
365
+ # @param container [Container] The container properties.
366
+ # @param resource_group_name [String] The resource group name.
367
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
368
+ # will be added to the HTTP request.
369
+ #
370
+ # @return [Container] operation results.
371
+ #
372
+ def begin_create_or_update(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:nil)
373
+ response = begin_create_or_update_async(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:custom_headers).value!
374
+ response.body unless response.nil?
375
+ end
376
+
377
+ #
378
+ # Creates a new container or updates an existing container on the device.
379
+ #
380
+ # @param device_name [String] The device name.
381
+ # @param storage_account_name [String] The Storage Account Name
382
+ # @param container_name [String] The container name.
383
+ # @param container [Container] The container properties.
384
+ # @param resource_group_name [String] The resource group name.
385
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
386
+ # will be added to the HTTP request.
387
+ #
388
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
389
+ #
390
+ def begin_create_or_update_with_http_info(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:nil)
391
+ begin_create_or_update_async(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:custom_headers).value!
392
+ end
393
+
394
+ #
395
+ # Creates a new container or updates an existing container on the device.
396
+ #
397
+ # @param device_name [String] The device name.
398
+ # @param storage_account_name [String] The Storage Account Name
399
+ # @param container_name [String] The container name.
400
+ # @param container [Container] The container properties.
401
+ # @param resource_group_name [String] The resource group name.
402
+ # @param [Hash{String => String}] A hash of custom headers that will be added
403
+ # to the HTTP request.
404
+ #
405
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
406
+ #
407
+ def begin_create_or_update_async(device_name, storage_account_name, container_name, container, resource_group_name, custom_headers:nil)
408
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
409
+ fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil?
410
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
411
+ fail ArgumentError, 'container is nil' if container.nil?
412
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
413
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
414
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
415
+
416
+
417
+ request_headers = {}
418
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
419
+
420
+ # Set Headers
421
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
422
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
423
+
424
+ # Serialize Request
425
+ request_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Container.mapper()
426
+ request_content = @client.serialize(request_mapper, container)
427
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
428
+
429
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'
430
+
431
+ request_url = @base_url || @client.base_url
432
+
433
+ options = {
434
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
435
+ path_params: {'deviceName' => device_name,'storageAccountName' => storage_account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
436
+ query_params: {'api-version' => @client.api_version},
437
+ body: request_content,
438
+ headers: request_headers.merge(custom_headers || {}),
439
+ base_url: request_url
440
+ }
441
+ promise = @client.make_request_async(:put, path_template, options)
442
+
443
+ promise = promise.then do |result|
444
+ http_response = result.response
445
+ status_code = http_response.status
446
+ response_content = http_response.body
447
+ unless status_code == 200 || status_code == 202
448
+ error_model = JSON.load(response_content)
449
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
450
+ end
451
+
452
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
453
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
454
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
455
+ # Deserialize Response
456
+ if status_code == 200
457
+ begin
458
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
459
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Container.mapper()
460
+ result.body = @client.deserialize(result_mapper, parsed_response)
461
+ rescue Exception => e
462
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
463
+ end
464
+ end
465
+
466
+ result
467
+ end
468
+
469
+ promise.execute
470
+ end
471
+
472
+ #
473
+ # Deletes the container on the Data Box Edge/Data Box Gateway device.
474
+ #
475
+ # @param device_name [String] The device name.
476
+ # @param storage_account_name [String] The Storage Account Name
477
+ # @param container_name [String] The container name.
478
+ # @param resource_group_name [String] The resource group name.
479
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
480
+ # will be added to the HTTP request.
481
+ #
482
+ #
483
+ def begin_delete(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
484
+ response = begin_delete_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
485
+ nil
486
+ end
487
+
488
+ #
489
+ # Deletes the container on the Data Box Edge/Data Box Gateway device.
490
+ #
491
+ # @param device_name [String] The device name.
492
+ # @param storage_account_name [String] The Storage Account Name
493
+ # @param container_name [String] The container name.
494
+ # @param resource_group_name [String] The resource group name.
495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
496
+ # will be added to the HTTP request.
497
+ #
498
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
499
+ #
500
+ def begin_delete_with_http_info(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
501
+ begin_delete_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
502
+ end
503
+
504
+ #
505
+ # Deletes the container on the Data Box Edge/Data Box Gateway device.
506
+ #
507
+ # @param device_name [String] The device name.
508
+ # @param storage_account_name [String] The Storage Account Name
509
+ # @param container_name [String] The container name.
510
+ # @param resource_group_name [String] The resource group name.
511
+ # @param [Hash{String => String}] A hash of custom headers that will be added
512
+ # to the HTTP request.
513
+ #
514
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
515
+ #
516
+ def begin_delete_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
517
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
518
+ fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil?
519
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
520
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
521
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
522
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
523
+
524
+
525
+ request_headers = {}
526
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
527
+
528
+ # Set Headers
529
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
530
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
531
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'
532
+
533
+ request_url = @base_url || @client.base_url
534
+
535
+ options = {
536
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
537
+ path_params: {'deviceName' => device_name,'storageAccountName' => storage_account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
538
+ query_params: {'api-version' => @client.api_version},
539
+ headers: request_headers.merge(custom_headers || {}),
540
+ base_url: request_url
541
+ }
542
+ promise = @client.make_request_async(:delete, path_template, options)
543
+
544
+ promise = promise.then do |result|
545
+ http_response = result.response
546
+ status_code = http_response.status
547
+ response_content = http_response.body
548
+ unless status_code == 202 || status_code == 204
549
+ error_model = JSON.load(response_content)
550
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
551
+ end
552
+
553
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
554
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
555
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
556
+
557
+ result
558
+ end
559
+
560
+ promise.execute
561
+ end
562
+
563
+ #
564
+ # Refreshes the container metadata with the data from the cloud.
565
+ #
566
+ # @param device_name [String] The device name.
567
+ # @param storage_account_name [String] The Storage Account Name
568
+ # @param container_name [String] The container name.
569
+ # @param resource_group_name [String] The resource group name.
570
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
571
+ # will be added to the HTTP request.
572
+ #
573
+ #
574
+ def begin_refresh(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
575
+ response = begin_refresh_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
576
+ nil
577
+ end
578
+
579
+ #
580
+ # Refreshes the container metadata with the data from the cloud.
581
+ #
582
+ # @param device_name [String] The device name.
583
+ # @param storage_account_name [String] The Storage Account Name
584
+ # @param container_name [String] The container name.
585
+ # @param resource_group_name [String] The resource group name.
586
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
587
+ # will be added to the HTTP request.
588
+ #
589
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
590
+ #
591
+ def begin_refresh_with_http_info(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
592
+ begin_refresh_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:custom_headers).value!
593
+ end
594
+
595
+ #
596
+ # Refreshes the container metadata with the data from the cloud.
597
+ #
598
+ # @param device_name [String] The device name.
599
+ # @param storage_account_name [String] The Storage Account Name
600
+ # @param container_name [String] The container name.
601
+ # @param resource_group_name [String] The resource group name.
602
+ # @param [Hash{String => String}] A hash of custom headers that will be added
603
+ # to the HTTP request.
604
+ #
605
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
606
+ #
607
+ def begin_refresh_async(device_name, storage_account_name, container_name, resource_group_name, custom_headers:nil)
608
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
609
+ fail ArgumentError, 'storage_account_name is nil' if storage_account_name.nil?
610
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
611
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
612
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
613
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
614
+
615
+
616
+ request_headers = {}
617
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
618
+
619
+ # Set Headers
620
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
621
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
622
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'
623
+
624
+ request_url = @base_url || @client.base_url
625
+
626
+ options = {
627
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
628
+ path_params: {'deviceName' => device_name,'storageAccountName' => storage_account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
629
+ query_params: {'api-version' => @client.api_version},
630
+ headers: request_headers.merge(custom_headers || {}),
631
+ base_url: request_url
632
+ }
633
+ promise = @client.make_request_async(:post, path_template, options)
634
+
635
+ promise = promise.then do |result|
636
+ http_response = result.response
637
+ status_code = http_response.status
638
+ response_content = http_response.body
639
+ unless status_code == 200 || status_code == 202
640
+ error_model = JSON.load(response_content)
641
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
642
+ end
643
+
644
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
645
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
646
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
647
+
648
+ result
649
+ end
650
+
651
+ promise.execute
652
+ end
653
+
654
+ #
655
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
656
+ # Gateway device.
657
+ #
658
+ # @param next_page_link [String] The NextLink from the previous successful call
659
+ # to List operation.
660
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
661
+ # will be added to the HTTP request.
662
+ #
663
+ # @return [ContainerList] operation results.
664
+ #
665
+ def list_by_storage_account_next(next_page_link, custom_headers:nil)
666
+ response = list_by_storage_account_next_async(next_page_link, custom_headers:custom_headers).value!
667
+ response.body unless response.nil?
668
+ end
669
+
670
+ #
671
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
672
+ # Gateway device.
673
+ #
674
+ # @param next_page_link [String] The NextLink from the previous successful call
675
+ # to List operation.
676
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
677
+ # will be added to the HTTP request.
678
+ #
679
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
680
+ #
681
+ def list_by_storage_account_next_with_http_info(next_page_link, custom_headers:nil)
682
+ list_by_storage_account_next_async(next_page_link, custom_headers:custom_headers).value!
683
+ end
684
+
685
+ #
686
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
687
+ # Gateway device.
688
+ #
689
+ # @param next_page_link [String] The NextLink from the previous successful call
690
+ # to List operation.
691
+ # @param [Hash{String => String}] A hash of custom headers that will be added
692
+ # to the HTTP request.
693
+ #
694
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
695
+ #
696
+ def list_by_storage_account_next_async(next_page_link, custom_headers:nil)
697
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
698
+
699
+
700
+ request_headers = {}
701
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
702
+
703
+ # Set Headers
704
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
705
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
706
+ path_template = '{nextLink}'
707
+
708
+ request_url = @base_url || @client.base_url
709
+
710
+ options = {
711
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
712
+ skip_encoding_path_params: {'nextLink' => next_page_link},
713
+ headers: request_headers.merge(custom_headers || {}),
714
+ base_url: request_url
715
+ }
716
+ promise = @client.make_request_async(:get, path_template, options)
717
+
718
+ promise = promise.then do |result|
719
+ http_response = result.response
720
+ status_code = http_response.status
721
+ response_content = http_response.body
722
+ unless status_code == 200
723
+ error_model = JSON.load(response_content)
724
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
725
+ end
726
+
727
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
728
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
729
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
730
+ # Deserialize Response
731
+ if status_code == 200
732
+ begin
733
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
734
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::ContainerList.mapper()
735
+ result.body = @client.deserialize(result_mapper, parsed_response)
736
+ rescue Exception => e
737
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
738
+ end
739
+ end
740
+
741
+ result
742
+ end
743
+
744
+ promise.execute
745
+ end
746
+
747
+ #
748
+ # Lists all the containers of a storage Account in a Data Box Edge/Data Box
749
+ # Gateway device.
750
+ #
751
+ # @param device_name [String] The device name.
752
+ # @param storage_account_name [String] The storage Account name.
753
+ # @param resource_group_name [String] The resource group name.
754
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
755
+ # will be added to the HTTP request.
756
+ #
757
+ # @return [ContainerList] which provide lazy access to pages of the response.
758
+ #
759
+ def list_by_storage_account_as_lazy(device_name, storage_account_name, resource_group_name, custom_headers:nil)
760
+ response = list_by_storage_account_async(device_name, storage_account_name, resource_group_name, custom_headers:custom_headers).value!
761
+ unless response.nil?
762
+ page = response.body
763
+ page.next_method = Proc.new do |next_page_link|
764
+ list_by_storage_account_next_async(next_page_link, custom_headers:custom_headers)
765
+ end
766
+ page
767
+ end
768
+ end
769
+
770
+ end
771
+ end