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,191 @@
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
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class DataBoxEdgeManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The API version.
21
+ attr_reader :api_version
22
+
23
+ # @return [String] The subscription ID.
24
+ attr_accessor :subscription_id
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Operations] operations
39
+ attr_reader :operations
40
+
41
+ # @return [Devices] devices
42
+ attr_reader :devices
43
+
44
+ # @return [Alerts] alerts
45
+ attr_reader :alerts
46
+
47
+ # @return [BandwidthSchedules] bandwidth_schedules
48
+ attr_reader :bandwidth_schedules
49
+
50
+ # @return [Jobs] jobs
51
+ attr_reader :jobs
52
+
53
+ # @return [Nodes] nodes
54
+ attr_reader :nodes
55
+
56
+ # @return [OperationsStatus] operations_status
57
+ attr_reader :operations_status
58
+
59
+ # @return [Orders] orders
60
+ attr_reader :orders
61
+
62
+ # @return [Roles] roles
63
+ attr_reader :roles
64
+
65
+ # @return [Shares] shares
66
+ attr_reader :shares
67
+
68
+ # @return [StorageAccountCredentials] storage_account_credentials
69
+ attr_reader :storage_account_credentials
70
+
71
+ # @return [StorageAccounts] storage_accounts
72
+ attr_reader :storage_accounts
73
+
74
+ # @return [Containers] containers
75
+ attr_reader :containers
76
+
77
+ # @return [Triggers] triggers
78
+ attr_reader :triggers
79
+
80
+ # @return [Users] users
81
+ attr_reader :users
82
+
83
+ # @return [Skus] skus
84
+ attr_reader :skus
85
+
86
+ #
87
+ # Creates initializes a new instance of the DataBoxEdgeManagementClient class.
88
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
89
+ # @param base_url [String] the base URI of the service.
90
+ # @param options [Array] filters to be applied to the HTTP requests.
91
+ #
92
+ def initialize(credentials = nil, base_url = nil, options = nil)
93
+ super(credentials, options)
94
+ @base_url = base_url || 'https://management.azure.com'
95
+
96
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
97
+ @credentials = credentials
98
+
99
+ @operations = Operations.new(self)
100
+ @devices = Devices.new(self)
101
+ @alerts = Alerts.new(self)
102
+ @bandwidth_schedules = BandwidthSchedules.new(self)
103
+ @jobs = Jobs.new(self)
104
+ @nodes = Nodes.new(self)
105
+ @operations_status = OperationsStatus.new(self)
106
+ @orders = Orders.new(self)
107
+ @roles = Roles.new(self)
108
+ @shares = Shares.new(self)
109
+ @storage_account_credentials = StorageAccountCredentials.new(self)
110
+ @storage_accounts = StorageAccounts.new(self)
111
+ @containers = Containers.new(self)
112
+ @triggers = Triggers.new(self)
113
+ @users = Users.new(self)
114
+ @skus = Skus.new(self)
115
+ @api_version = '2019-08-01'
116
+ @accept_language = 'en-US'
117
+ @long_running_operation_retry_timeout = 30
118
+ @generate_client_request_id = true
119
+ add_telemetry
120
+ end
121
+
122
+ #
123
+ # Makes a request and returns the body of the response.
124
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
125
+ # @param path [String] the path, relative to {base_url}.
126
+ # @param options [Hash{String=>String}] specifying any request options like :body.
127
+ # @return [Hash{String=>String}] containing the body of the response.
128
+ # Example:
129
+ #
130
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
131
+ # path = "/path"
132
+ # options = {
133
+ # body: request_content,
134
+ # query_params: {'api-version' => '2016-02-01'}
135
+ # }
136
+ # result = @client.make_request(:put, path, options)
137
+ #
138
+ def make_request(method, path, options = {})
139
+ result = make_request_with_http_info(method, path, options)
140
+ result.body unless result.nil?
141
+ end
142
+
143
+ #
144
+ # Makes a request and returns the operation response.
145
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
146
+ # @param path [String] the path, relative to {base_url}.
147
+ # @param options [Hash{String=>String}] specifying any request options like :body.
148
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
149
+ #
150
+ def make_request_with_http_info(method, path, options = {})
151
+ result = make_request_async(method, path, options).value!
152
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
153
+ result
154
+ end
155
+
156
+ #
157
+ # Makes a request asynchronously.
158
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
159
+ # @param path [String] the path, relative to {base_url}.
160
+ # @param options [Hash{String=>String}] specifying any request options like :body.
161
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
162
+ #
163
+ def make_request_async(method, path, options = {})
164
+ fail ArgumentError, 'method is nil' if method.nil?
165
+ fail ArgumentError, 'path is nil' if path.nil?
166
+
167
+ request_url = options[:base_url] || @base_url
168
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
169
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
170
+ end
171
+
172
+ request_headers = @request_headers
173
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
174
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
175
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
176
+
177
+ super(request_url, method, path, options)
178
+ end
179
+
180
+
181
+ private
182
+ #
183
+ # Adds telemetry information.
184
+ #
185
+ def add_telemetry
186
+ sdk_information = 'azure_mgmt_databoxedge'
187
+ sdk_information = "#{sdk_information}/0.17.0"
188
+ add_user_agent_information(sdk_information)
189
+ end
190
+ end
191
+ end
@@ -0,0 +1,1811 @@
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
+ # Devices
9
+ #
10
+ class Devices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Devices 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
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
26
+ #
27
+ # @param expand [String] Specify $expand=details to populate additional fields
28
+ # related to the resource or Specify $skipToken=<token> to populate the next
29
+ # page in the list.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<DataBoxEdgeDevice>] operation results.
34
+ #
35
+ def list_by_subscription(expand:nil, custom_headers:nil)
36
+ first_page = list_by_subscription_as_lazy(expand:expand, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
42
+ #
43
+ # @param expand [String] Specify $expand=details to populate additional fields
44
+ # related to the resource or Specify $skipToken=<token> to populate the next
45
+ # page in the list.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_by_subscription_with_http_info(expand:nil, custom_headers:nil)
52
+ list_by_subscription_async(expand:expand, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
57
+ #
58
+ # @param expand [String] Specify $expand=details to populate additional fields
59
+ # related to the resource or Specify $skipToken=<token> to populate the next
60
+ # page in the list.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_by_subscription_async(expand:nil, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
+
70
+
71
+ request_headers = {}
72
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
73
+
74
+ # Set Headers
75
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'
78
+
79
+ request_url = @base_url || @client.base_url
80
+
81
+ options = {
82
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
83
+ path_params: {'subscriptionId' => @client.subscription_id},
84
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
85
+ headers: request_headers.merge(custom_headers || {}),
86
+ base_url: request_url
87
+ }
88
+ promise = @client.make_request_async(:get, path_template, options)
89
+
90
+ promise = promise.then do |result|
91
+ http_response = result.response
92
+ status_code = http_response.status
93
+ response_content = http_response.body
94
+ unless status_code == 200
95
+ error_model = JSON.load(response_content)
96
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
97
+ end
98
+
99
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
101
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
102
+ # Deserialize Response
103
+ if status_code == 200
104
+ begin
105
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
106
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDeviceList.mapper()
107
+ result.body = @client.deserialize(result_mapper, parsed_response)
108
+ rescue Exception => e
109
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
110
+ end
111
+ end
112
+
113
+ result
114
+ end
115
+
116
+ promise.execute
117
+ end
118
+
119
+ #
120
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
121
+ #
122
+ # @param resource_group_name [String] The resource group name.
123
+ # @param expand [String] Specify $expand=details to populate additional fields
124
+ # related to the resource or Specify $skipToken=<token> to populate the next
125
+ # page in the list.
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [Array<DataBoxEdgeDevice>] operation results.
130
+ #
131
+ def list_by_resource_group(resource_group_name, expand:nil, custom_headers:nil)
132
+ first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, custom_headers:custom_headers)
133
+ first_page.get_all_items
134
+ end
135
+
136
+ #
137
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
138
+ #
139
+ # @param resource_group_name [String] The resource group name.
140
+ # @param expand [String] Specify $expand=details to populate additional fields
141
+ # related to the resource or Specify $skipToken=<token> to populate the next
142
+ # page in the list.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
147
+ #
148
+ def list_by_resource_group_with_http_info(resource_group_name, expand:nil, custom_headers:nil)
149
+ list_by_resource_group_async(resource_group_name, expand:expand, custom_headers:custom_headers).value!
150
+ end
151
+
152
+ #
153
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
154
+ #
155
+ # @param resource_group_name [String] The resource group name.
156
+ # @param expand [String] Specify $expand=details to populate additional fields
157
+ # related to the resource or Specify $skipToken=<token> to populate the next
158
+ # page in the list.
159
+ # @param [Hash{String => String}] A hash of custom headers that will be added
160
+ # to the HTTP request.
161
+ #
162
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
163
+ #
164
+ def list_by_resource_group_async(resource_group_name, expand:nil, custom_headers:nil)
165
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
166
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
167
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
168
+
169
+
170
+ request_headers = {}
171
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
172
+
173
+ # Set Headers
174
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
175
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
176
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'
177
+
178
+ request_url = @base_url || @client.base_url
179
+
180
+ options = {
181
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
182
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
183
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
184
+ headers: request_headers.merge(custom_headers || {}),
185
+ base_url: request_url
186
+ }
187
+ promise = @client.make_request_async(:get, path_template, options)
188
+
189
+ promise = promise.then do |result|
190
+ http_response = result.response
191
+ status_code = http_response.status
192
+ response_content = http_response.body
193
+ unless status_code == 200
194
+ error_model = JSON.load(response_content)
195
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
196
+ end
197
+
198
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
199
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
200
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
201
+ # Deserialize Response
202
+ if status_code == 200
203
+ begin
204
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
205
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDeviceList.mapper()
206
+ result.body = @client.deserialize(result_mapper, parsed_response)
207
+ rescue Exception => e
208
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
209
+ end
210
+ end
211
+
212
+ result
213
+ end
214
+
215
+ promise.execute
216
+ end
217
+
218
+ #
219
+ # Gets the properties of the Data Box Edge/Data Box Gateway device.
220
+ #
221
+ # @param device_name [String] The device name.
222
+ # @param resource_group_name [String] The resource group name.
223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
+ # will be added to the HTTP request.
225
+ #
226
+ # @return [DataBoxEdgeDevice] operation results.
227
+ #
228
+ def get(device_name, resource_group_name, custom_headers:nil)
229
+ response = get_async(device_name, resource_group_name, custom_headers:custom_headers).value!
230
+ response.body unless response.nil?
231
+ end
232
+
233
+ #
234
+ # Gets the properties of the Data Box Edge/Data Box Gateway device.
235
+ #
236
+ # @param device_name [String] The device name.
237
+ # @param resource_group_name [String] The resource group name.
238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
239
+ # will be added to the HTTP request.
240
+ #
241
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
242
+ #
243
+ def get_with_http_info(device_name, resource_group_name, custom_headers:nil)
244
+ get_async(device_name, resource_group_name, custom_headers:custom_headers).value!
245
+ end
246
+
247
+ #
248
+ # Gets the properties of the Data Box Edge/Data Box Gateway device.
249
+ #
250
+ # @param device_name [String] The device name.
251
+ # @param resource_group_name [String] The resource group name.
252
+ # @param [Hash{String => String}] A hash of custom headers that will be added
253
+ # to the HTTP request.
254
+ #
255
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
256
+ #
257
+ def get_async(device_name, resource_group_name, custom_headers:nil)
258
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
259
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
260
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
261
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
262
+
263
+
264
+ request_headers = {}
265
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
266
+
267
+ # Set Headers
268
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
269
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
270
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
271
+
272
+ request_url = @base_url || @client.base_url
273
+
274
+ options = {
275
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
276
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
277
+ query_params: {'api-version' => @client.api_version},
278
+ headers: request_headers.merge(custom_headers || {}),
279
+ base_url: request_url
280
+ }
281
+ promise = @client.make_request_async(:get, path_template, options)
282
+
283
+ promise = promise.then do |result|
284
+ http_response = result.response
285
+ status_code = http_response.status
286
+ response_content = http_response.body
287
+ unless status_code == 200
288
+ error_model = JSON.load(response_content)
289
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
290
+ end
291
+
292
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
293
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
294
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
295
+ # Deserialize Response
296
+ if status_code == 200
297
+ begin
298
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
299
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDevice.mapper()
300
+ result.body = @client.deserialize(result_mapper, parsed_response)
301
+ rescue Exception => e
302
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
303
+ end
304
+ end
305
+
306
+ result
307
+ end
308
+
309
+ promise.execute
310
+ end
311
+
312
+ #
313
+ # Creates or updates a Data Box Edge/Data Box Gateway resource.
314
+ #
315
+ # @param device_name [String] The device name.
316
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
317
+ # @param resource_group_name [String] The resource group name.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [DataBoxEdgeDevice] operation results.
322
+ #
323
+ def create_or_update(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
324
+ response = create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers).value!
325
+ response.body unless response.nil?
326
+ end
327
+
328
+ #
329
+ # @param device_name [String] The device name.
330
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
331
+ # @param resource_group_name [String] The resource group name.
332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
333
+ # will be added to the HTTP request.
334
+ #
335
+ # @return [Concurrent::Promise] promise which provides async access to http
336
+ # response.
337
+ #
338
+ def create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
339
+ # Send request
340
+ promise = begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers)
341
+
342
+ promise = promise.then do |response|
343
+ # Defining deserialization method.
344
+ deserialize_method = lambda do |parsed_response|
345
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDevice.mapper()
346
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
347
+ end
348
+
349
+ # Waiting for response.
350
+ @client.get_long_running_operation_result(response, deserialize_method)
351
+ end
352
+
353
+ promise
354
+ end
355
+
356
+ #
357
+ # Deletes the Data Box Edge/Data Box Gateway device.
358
+ #
359
+ # @param device_name [String] The device name.
360
+ # @param resource_group_name [String] The resource group name.
361
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
362
+ # will be added to the HTTP request.
363
+ #
364
+ def delete(device_name, resource_group_name, custom_headers:nil)
365
+ response = delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
366
+ nil
367
+ end
368
+
369
+ #
370
+ # @param device_name [String] The device name.
371
+ # @param resource_group_name [String] The resource group name.
372
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
373
+ # will be added to the HTTP request.
374
+ #
375
+ # @return [Concurrent::Promise] promise which provides async access to http
376
+ # response.
377
+ #
378
+ def delete_async(device_name, resource_group_name, custom_headers:nil)
379
+ # Send request
380
+ promise = begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers)
381
+
382
+ promise = promise.then do |response|
383
+ # Defining deserialization method.
384
+ deserialize_method = lambda do |parsed_response|
385
+ end
386
+
387
+ # Waiting for response.
388
+ @client.get_long_running_operation_result(response, deserialize_method)
389
+ end
390
+
391
+ promise
392
+ end
393
+
394
+ #
395
+ # Modifies a Data Box Edge/Data Box Gateway resource.
396
+ #
397
+ # @param device_name [String] The device name.
398
+ # @param parameters [DataBoxEdgeDevicePatch] The resource parameters.
399
+ # @param resource_group_name [String] The resource group name.
400
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
401
+ # will be added to the HTTP request.
402
+ #
403
+ # @return [DataBoxEdgeDevice] operation results.
404
+ #
405
+ def update(device_name, parameters, resource_group_name, custom_headers:nil)
406
+ response = update_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
407
+ response.body unless response.nil?
408
+ end
409
+
410
+ #
411
+ # Modifies a Data Box Edge/Data Box Gateway resource.
412
+ #
413
+ # @param device_name [String] The device name.
414
+ # @param parameters [DataBoxEdgeDevicePatch] The resource parameters.
415
+ # @param resource_group_name [String] The resource group name.
416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
417
+ # will be added to the HTTP request.
418
+ #
419
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
420
+ #
421
+ def update_with_http_info(device_name, parameters, resource_group_name, custom_headers:nil)
422
+ update_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
423
+ end
424
+
425
+ #
426
+ # Modifies a Data Box Edge/Data Box Gateway resource.
427
+ #
428
+ # @param device_name [String] The device name.
429
+ # @param parameters [DataBoxEdgeDevicePatch] The resource parameters.
430
+ # @param resource_group_name [String] The resource group name.
431
+ # @param [Hash{String => String}] A hash of custom headers that will be added
432
+ # to the HTTP request.
433
+ #
434
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
435
+ #
436
+ def update_async(device_name, parameters, resource_group_name, custom_headers:nil)
437
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
438
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
439
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
440
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
441
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
442
+
443
+
444
+ request_headers = {}
445
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
446
+
447
+ # Set Headers
448
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
449
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
450
+
451
+ # Serialize Request
452
+ request_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDevicePatch.mapper()
453
+ request_content = @client.serialize(request_mapper, parameters)
454
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
455
+
456
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
457
+
458
+ request_url = @base_url || @client.base_url
459
+
460
+ options = {
461
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
462
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
463
+ query_params: {'api-version' => @client.api_version},
464
+ body: request_content,
465
+ headers: request_headers.merge(custom_headers || {}),
466
+ base_url: request_url
467
+ }
468
+ promise = @client.make_request_async(:patch, path_template, options)
469
+
470
+ promise = promise.then do |result|
471
+ http_response = result.response
472
+ status_code = http_response.status
473
+ response_content = http_response.body
474
+ unless status_code == 200
475
+ error_model = JSON.load(response_content)
476
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
477
+ end
478
+
479
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
480
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
481
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
482
+ # Deserialize Response
483
+ if status_code == 200
484
+ begin
485
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
486
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDevice.mapper()
487
+ result.body = @client.deserialize(result_mapper, parsed_response)
488
+ rescue Exception => e
489
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
490
+ end
491
+ end
492
+
493
+ result
494
+ end
495
+
496
+ promise.execute
497
+ end
498
+
499
+ #
500
+ # Downloads the updates on a Data Box Edge/Data Box Gateway device.
501
+ #
502
+ # @param device_name [String] The device name.
503
+ # @param resource_group_name [String] The resource group name.
504
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
505
+ # will be added to the HTTP request.
506
+ #
507
+ def download_updates(device_name, resource_group_name, custom_headers:nil)
508
+ response = download_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
509
+ nil
510
+ end
511
+
512
+ #
513
+ # @param device_name [String] The device name.
514
+ # @param resource_group_name [String] The resource group name.
515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
516
+ # will be added to the HTTP request.
517
+ #
518
+ # @return [Concurrent::Promise] promise which provides async access to http
519
+ # response.
520
+ #
521
+ def download_updates_async(device_name, resource_group_name, custom_headers:nil)
522
+ # Send request
523
+ promise = begin_download_updates_async(device_name, resource_group_name, custom_headers:custom_headers)
524
+
525
+ promise = promise.then do |response|
526
+ # Defining deserialization method.
527
+ deserialize_method = lambda do |parsed_response|
528
+ end
529
+
530
+ # Waiting for response.
531
+ @client.get_long_running_operation_result(response, deserialize_method)
532
+ end
533
+
534
+ promise
535
+ end
536
+
537
+ #
538
+ # Gets additional information for the specified Data Box Edge/Data Box Gateway
539
+ # device.
540
+ #
541
+ # @param device_name [String] The device name.
542
+ # @param resource_group_name [String] The resource group name.
543
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
544
+ # will be added to the HTTP request.
545
+ #
546
+ # @return [DataBoxEdgeDeviceExtendedInfo] operation results.
547
+ #
548
+ def get_extended_information(device_name, resource_group_name, custom_headers:nil)
549
+ response = get_extended_information_async(device_name, resource_group_name, custom_headers:custom_headers).value!
550
+ response.body unless response.nil?
551
+ end
552
+
553
+ #
554
+ # Gets additional information for the specified Data Box Edge/Data Box Gateway
555
+ # device.
556
+ #
557
+ # @param device_name [String] The device name.
558
+ # @param resource_group_name [String] The resource group name.
559
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
560
+ # will be added to the HTTP request.
561
+ #
562
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
563
+ #
564
+ def get_extended_information_with_http_info(device_name, resource_group_name, custom_headers:nil)
565
+ get_extended_information_async(device_name, resource_group_name, custom_headers:custom_headers).value!
566
+ end
567
+
568
+ #
569
+ # Gets additional information for the specified Data Box Edge/Data Box Gateway
570
+ # device.
571
+ #
572
+ # @param device_name [String] The device name.
573
+ # @param resource_group_name [String] The resource group name.
574
+ # @param [Hash{String => String}] A hash of custom headers that will be added
575
+ # to the HTTP request.
576
+ #
577
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
578
+ #
579
+ def get_extended_information_async(device_name, resource_group_name, custom_headers:nil)
580
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
581
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
582
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
583
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
584
+
585
+
586
+ request_headers = {}
587
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
588
+
589
+ # Set Headers
590
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
591
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
592
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'
593
+
594
+ request_url = @base_url || @client.base_url
595
+
596
+ options = {
597
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
598
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
599
+ query_params: {'api-version' => @client.api_version},
600
+ headers: request_headers.merge(custom_headers || {}),
601
+ base_url: request_url
602
+ }
603
+ promise = @client.make_request_async(:post, path_template, options)
604
+
605
+ promise = promise.then do |result|
606
+ http_response = result.response
607
+ status_code = http_response.status
608
+ response_content = http_response.body
609
+ unless status_code == 200
610
+ error_model = JSON.load(response_content)
611
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
612
+ end
613
+
614
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
615
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
616
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
617
+ # Deserialize Response
618
+ if status_code == 200
619
+ begin
620
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
621
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDeviceExtendedInfo.mapper()
622
+ result.body = @client.deserialize(result_mapper, parsed_response)
623
+ rescue Exception => e
624
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
625
+ end
626
+ end
627
+
628
+ result
629
+ end
630
+
631
+ promise.execute
632
+ end
633
+
634
+ #
635
+ # Installs the updates on the Data Box Edge/Data Box Gateway device.
636
+ #
637
+ # @param device_name [String] The device name.
638
+ # @param resource_group_name [String] The resource group name.
639
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
640
+ # will be added to the HTTP request.
641
+ #
642
+ def install_updates(device_name, resource_group_name, custom_headers:nil)
643
+ response = install_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
644
+ nil
645
+ end
646
+
647
+ #
648
+ # @param device_name [String] The device name.
649
+ # @param resource_group_name [String] The resource group name.
650
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
651
+ # will be added to the HTTP request.
652
+ #
653
+ # @return [Concurrent::Promise] promise which provides async access to http
654
+ # response.
655
+ #
656
+ def install_updates_async(device_name, resource_group_name, custom_headers:nil)
657
+ # Send request
658
+ promise = begin_install_updates_async(device_name, resource_group_name, custom_headers:custom_headers)
659
+
660
+ promise = promise.then do |response|
661
+ # Defining deserialization method.
662
+ deserialize_method = lambda do |parsed_response|
663
+ end
664
+
665
+ # Waiting for response.
666
+ @client.get_long_running_operation_result(response, deserialize_method)
667
+ end
668
+
669
+ promise
670
+ end
671
+
672
+ #
673
+ # Gets the network settings of the specified Data Box Edge/Data Box Gateway
674
+ # device.
675
+ #
676
+ # @param device_name [String] The device name.
677
+ # @param resource_group_name [String] The resource group name.
678
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
679
+ # will be added to the HTTP request.
680
+ #
681
+ # @return [NetworkSettings] operation results.
682
+ #
683
+ def get_network_settings(device_name, resource_group_name, custom_headers:nil)
684
+ response = get_network_settings_async(device_name, resource_group_name, custom_headers:custom_headers).value!
685
+ response.body unless response.nil?
686
+ end
687
+
688
+ #
689
+ # Gets the network settings of the specified Data Box Edge/Data Box Gateway
690
+ # device.
691
+ #
692
+ # @param device_name [String] The device name.
693
+ # @param resource_group_name [String] The resource group name.
694
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
695
+ # will be added to the HTTP request.
696
+ #
697
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
698
+ #
699
+ def get_network_settings_with_http_info(device_name, resource_group_name, custom_headers:nil)
700
+ get_network_settings_async(device_name, resource_group_name, custom_headers:custom_headers).value!
701
+ end
702
+
703
+ #
704
+ # Gets the network settings of the specified Data Box Edge/Data Box Gateway
705
+ # device.
706
+ #
707
+ # @param device_name [String] The device name.
708
+ # @param resource_group_name [String] The resource group name.
709
+ # @param [Hash{String => String}] A hash of custom headers that will be added
710
+ # to the HTTP request.
711
+ #
712
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
713
+ #
714
+ def get_network_settings_async(device_name, resource_group_name, custom_headers:nil)
715
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
716
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
717
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
718
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
719
+
720
+
721
+ request_headers = {}
722
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
723
+
724
+ # Set Headers
725
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
726
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
727
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'
728
+
729
+ request_url = @base_url || @client.base_url
730
+
731
+ options = {
732
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
733
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
734
+ query_params: {'api-version' => @client.api_version},
735
+ headers: request_headers.merge(custom_headers || {}),
736
+ base_url: request_url
737
+ }
738
+ promise = @client.make_request_async(:get, path_template, options)
739
+
740
+ promise = promise.then do |result|
741
+ http_response = result.response
742
+ status_code = http_response.status
743
+ response_content = http_response.body
744
+ unless status_code == 200
745
+ error_model = JSON.load(response_content)
746
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
747
+ end
748
+
749
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
750
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
751
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
752
+ # Deserialize Response
753
+ if status_code == 200
754
+ begin
755
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
756
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::NetworkSettings.mapper()
757
+ result.body = @client.deserialize(result_mapper, parsed_response)
758
+ rescue Exception => e
759
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
760
+ end
761
+ end
762
+
763
+ result
764
+ end
765
+
766
+ promise.execute
767
+ end
768
+
769
+ #
770
+ # Scans for updates on a Data Box Edge/Data Box Gateway device.
771
+ #
772
+ # @param device_name [String] The device name.
773
+ # @param resource_group_name [String] The resource group name.
774
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
775
+ # will be added to the HTTP request.
776
+ #
777
+ def scan_for_updates(device_name, resource_group_name, custom_headers:nil)
778
+ response = scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
779
+ nil
780
+ end
781
+
782
+ #
783
+ # @param device_name [String] The device name.
784
+ # @param resource_group_name [String] The resource group name.
785
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
786
+ # will be added to the HTTP request.
787
+ #
788
+ # @return [Concurrent::Promise] promise which provides async access to http
789
+ # response.
790
+ #
791
+ def scan_for_updates_async(device_name, resource_group_name, custom_headers:nil)
792
+ # Send request
793
+ promise = begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers)
794
+
795
+ promise = promise.then do |response|
796
+ # Defining deserialization method.
797
+ deserialize_method = lambda do |parsed_response|
798
+ end
799
+
800
+ # Waiting for response.
801
+ @client.get_long_running_operation_result(response, deserialize_method)
802
+ end
803
+
804
+ promise
805
+ end
806
+
807
+ #
808
+ # Updates the security settings on a Data Box Edge/Data Box Gateway device.
809
+ #
810
+ # @param device_name [String] The device name.
811
+ # @param security_settings [SecuritySettings] The security settings.
812
+ # @param resource_group_name [String] The resource group name.
813
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
814
+ # will be added to the HTTP request.
815
+ #
816
+ def create_or_update_security_settings(device_name, security_settings, resource_group_name, custom_headers:nil)
817
+ response = create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers).value!
818
+ nil
819
+ end
820
+
821
+ #
822
+ # @param device_name [String] The device name.
823
+ # @param security_settings [SecuritySettings] The security settings.
824
+ # @param resource_group_name [String] The resource group name.
825
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
826
+ # will be added to the HTTP request.
827
+ #
828
+ # @return [Concurrent::Promise] promise which provides async access to http
829
+ # response.
830
+ #
831
+ def create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:nil)
832
+ # Send request
833
+ promise = begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers)
834
+
835
+ promise = promise.then do |response|
836
+ # Defining deserialization method.
837
+ deserialize_method = lambda do |parsed_response|
838
+ end
839
+
840
+ # Waiting for response.
841
+ @client.get_long_running_operation_result(response, deserialize_method)
842
+ end
843
+
844
+ promise
845
+ end
846
+
847
+ #
848
+ # Gets information about the availability of updates based on the last scan of
849
+ # the device. It also gets information about any ongoing download or install
850
+ # jobs on the device.
851
+ #
852
+ # @param device_name [String] The device name.
853
+ # @param resource_group_name [String] The resource group name.
854
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
855
+ # will be added to the HTTP request.
856
+ #
857
+ # @return [UpdateSummary] operation results.
858
+ #
859
+ def get_update_summary(device_name, resource_group_name, custom_headers:nil)
860
+ response = get_update_summary_async(device_name, resource_group_name, custom_headers:custom_headers).value!
861
+ response.body unless response.nil?
862
+ end
863
+
864
+ #
865
+ # Gets information about the availability of updates based on the last scan of
866
+ # the device. It also gets information about any ongoing download or install
867
+ # jobs on the device.
868
+ #
869
+ # @param device_name [String] The device name.
870
+ # @param resource_group_name [String] The resource group name.
871
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
872
+ # will be added to the HTTP request.
873
+ #
874
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
875
+ #
876
+ def get_update_summary_with_http_info(device_name, resource_group_name, custom_headers:nil)
877
+ get_update_summary_async(device_name, resource_group_name, custom_headers:custom_headers).value!
878
+ end
879
+
880
+ #
881
+ # Gets information about the availability of updates based on the last scan of
882
+ # the device. It also gets information about any ongoing download or install
883
+ # jobs on the device.
884
+ #
885
+ # @param device_name [String] The device name.
886
+ # @param resource_group_name [String] The resource group name.
887
+ # @param [Hash{String => String}] A hash of custom headers that will be added
888
+ # to the HTTP request.
889
+ #
890
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
891
+ #
892
+ def get_update_summary_async(device_name, resource_group_name, custom_headers:nil)
893
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
894
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
895
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
896
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
897
+
898
+
899
+ request_headers = {}
900
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
901
+
902
+ # Set Headers
903
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
904
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
905
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'
906
+
907
+ request_url = @base_url || @client.base_url
908
+
909
+ options = {
910
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
911
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
912
+ query_params: {'api-version' => @client.api_version},
913
+ headers: request_headers.merge(custom_headers || {}),
914
+ base_url: request_url
915
+ }
916
+ promise = @client.make_request_async(:get, path_template, options)
917
+
918
+ promise = promise.then do |result|
919
+ http_response = result.response
920
+ status_code = http_response.status
921
+ response_content = http_response.body
922
+ unless status_code == 200
923
+ error_model = JSON.load(response_content)
924
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
925
+ end
926
+
927
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
928
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
929
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
930
+ # Deserialize Response
931
+ if status_code == 200
932
+ begin
933
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
934
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::UpdateSummary.mapper()
935
+ result.body = @client.deserialize(result_mapper, parsed_response)
936
+ rescue Exception => e
937
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
938
+ end
939
+ end
940
+
941
+ result
942
+ end
943
+
944
+ promise.execute
945
+ end
946
+
947
+ #
948
+ # Uploads registration certificate for the device.
949
+ #
950
+ # @param device_name [String] The device name.
951
+ # @param parameters [UploadCertificateRequest] The upload certificate request.
952
+ # @param resource_group_name [String] The resource group name.
953
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
954
+ # will be added to the HTTP request.
955
+ #
956
+ # @return [UploadCertificateResponse] operation results.
957
+ #
958
+ def upload_certificate(device_name, parameters, resource_group_name, custom_headers:nil)
959
+ response = upload_certificate_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
960
+ response.body unless response.nil?
961
+ end
962
+
963
+ #
964
+ # Uploads registration certificate for the device.
965
+ #
966
+ # @param device_name [String] The device name.
967
+ # @param parameters [UploadCertificateRequest] The upload certificate request.
968
+ # @param resource_group_name [String] The resource group name.
969
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
970
+ # will be added to the HTTP request.
971
+ #
972
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
973
+ #
974
+ def upload_certificate_with_http_info(device_name, parameters, resource_group_name, custom_headers:nil)
975
+ upload_certificate_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
976
+ end
977
+
978
+ #
979
+ # Uploads registration certificate for the device.
980
+ #
981
+ # @param device_name [String] The device name.
982
+ # @param parameters [UploadCertificateRequest] The upload certificate request.
983
+ # @param resource_group_name [String] The resource group name.
984
+ # @param [Hash{String => String}] A hash of custom headers that will be added
985
+ # to the HTTP request.
986
+ #
987
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
988
+ #
989
+ def upload_certificate_async(device_name, parameters, resource_group_name, custom_headers:nil)
990
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
991
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
992
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
993
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
994
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
995
+
996
+
997
+ request_headers = {}
998
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
999
+
1000
+ # Set Headers
1001
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1002
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1003
+
1004
+ # Serialize Request
1005
+ request_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::UploadCertificateRequest.mapper()
1006
+ request_content = @client.serialize(request_mapper, parameters)
1007
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1008
+
1009
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate'
1010
+
1011
+ request_url = @base_url || @client.base_url
1012
+
1013
+ options = {
1014
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1015
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1016
+ query_params: {'api-version' => @client.api_version},
1017
+ body: request_content,
1018
+ headers: request_headers.merge(custom_headers || {}),
1019
+ base_url: request_url
1020
+ }
1021
+ promise = @client.make_request_async(:post, path_template, options)
1022
+
1023
+ promise = promise.then do |result|
1024
+ http_response = result.response
1025
+ status_code = http_response.status
1026
+ response_content = http_response.body
1027
+ unless status_code == 200
1028
+ error_model = JSON.load(response_content)
1029
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1030
+ end
1031
+
1032
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1033
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1034
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1035
+ # Deserialize Response
1036
+ if status_code == 200
1037
+ begin
1038
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1039
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::UploadCertificateResponse.mapper()
1040
+ result.body = @client.deserialize(result_mapper, parsed_response)
1041
+ rescue Exception => e
1042
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1043
+ end
1044
+ end
1045
+
1046
+ result
1047
+ end
1048
+
1049
+ promise.execute
1050
+ end
1051
+
1052
+ #
1053
+ # Creates or updates a Data Box Edge/Data Box Gateway resource.
1054
+ #
1055
+ # @param device_name [String] The device name.
1056
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
1057
+ # @param resource_group_name [String] The resource group name.
1058
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1059
+ # will be added to the HTTP request.
1060
+ #
1061
+ # @return [DataBoxEdgeDevice] operation results.
1062
+ #
1063
+ def begin_create_or_update(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
1064
+ response = begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers).value!
1065
+ response.body unless response.nil?
1066
+ end
1067
+
1068
+ #
1069
+ # Creates or updates a Data Box Edge/Data Box Gateway resource.
1070
+ #
1071
+ # @param device_name [String] The device name.
1072
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
1073
+ # @param resource_group_name [String] The resource group name.
1074
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1075
+ # will be added to the HTTP request.
1076
+ #
1077
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1078
+ #
1079
+ def begin_create_or_update_with_http_info(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
1080
+ begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers).value!
1081
+ end
1082
+
1083
+ #
1084
+ # Creates or updates a Data Box Edge/Data Box Gateway resource.
1085
+ #
1086
+ # @param device_name [String] The device name.
1087
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
1088
+ # @param resource_group_name [String] The resource group name.
1089
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1090
+ # to the HTTP request.
1091
+ #
1092
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1093
+ #
1094
+ def begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
1095
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1096
+ fail ArgumentError, 'data_box_edge_device is nil' if data_box_edge_device.nil?
1097
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1098
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1099
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1100
+
1101
+
1102
+ request_headers = {}
1103
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1104
+
1105
+ # Set Headers
1106
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1107
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1108
+
1109
+ # Serialize Request
1110
+ request_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDevice.mapper()
1111
+ request_content = @client.serialize(request_mapper, data_box_edge_device)
1112
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1113
+
1114
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
1115
+
1116
+ request_url = @base_url || @client.base_url
1117
+
1118
+ options = {
1119
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1120
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1121
+ query_params: {'api-version' => @client.api_version},
1122
+ body: request_content,
1123
+ headers: request_headers.merge(custom_headers || {}),
1124
+ base_url: request_url
1125
+ }
1126
+ promise = @client.make_request_async(:put, path_template, options)
1127
+
1128
+ promise = promise.then do |result|
1129
+ http_response = result.response
1130
+ status_code = http_response.status
1131
+ response_content = http_response.body
1132
+ unless status_code == 200
1133
+ error_model = JSON.load(response_content)
1134
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1135
+ end
1136
+
1137
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1138
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1139
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1140
+ # Deserialize Response
1141
+ if status_code == 200
1142
+ begin
1143
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1144
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDevice.mapper()
1145
+ result.body = @client.deserialize(result_mapper, parsed_response)
1146
+ rescue Exception => e
1147
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1148
+ end
1149
+ end
1150
+
1151
+ result
1152
+ end
1153
+
1154
+ promise.execute
1155
+ end
1156
+
1157
+ #
1158
+ # Deletes the Data Box Edge/Data Box Gateway device.
1159
+ #
1160
+ # @param device_name [String] The device name.
1161
+ # @param resource_group_name [String] The resource group name.
1162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1163
+ # will be added to the HTTP request.
1164
+ #
1165
+ #
1166
+ def begin_delete(device_name, resource_group_name, custom_headers:nil)
1167
+ response = begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1168
+ nil
1169
+ end
1170
+
1171
+ #
1172
+ # Deletes the Data Box Edge/Data Box Gateway device.
1173
+ #
1174
+ # @param device_name [String] The device name.
1175
+ # @param resource_group_name [String] The resource group name.
1176
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1177
+ # will be added to the HTTP request.
1178
+ #
1179
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1180
+ #
1181
+ def begin_delete_with_http_info(device_name, resource_group_name, custom_headers:nil)
1182
+ begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1183
+ end
1184
+
1185
+ #
1186
+ # Deletes the Data Box Edge/Data Box Gateway device.
1187
+ #
1188
+ # @param device_name [String] The device name.
1189
+ # @param resource_group_name [String] The resource group name.
1190
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1191
+ # to the HTTP request.
1192
+ #
1193
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1194
+ #
1195
+ def begin_delete_async(device_name, resource_group_name, custom_headers:nil)
1196
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1197
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1198
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1199
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1200
+
1201
+
1202
+ request_headers = {}
1203
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1204
+
1205
+ # Set Headers
1206
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1207
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1208
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
1209
+
1210
+ request_url = @base_url || @client.base_url
1211
+
1212
+ options = {
1213
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1214
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1215
+ query_params: {'api-version' => @client.api_version},
1216
+ headers: request_headers.merge(custom_headers || {}),
1217
+ base_url: request_url
1218
+ }
1219
+ promise = @client.make_request_async(:delete, path_template, options)
1220
+
1221
+ promise = promise.then do |result|
1222
+ http_response = result.response
1223
+ status_code = http_response.status
1224
+ response_content = http_response.body
1225
+ unless status_code == 200 || status_code == 202 || status_code == 204
1226
+ error_model = JSON.load(response_content)
1227
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1228
+ end
1229
+
1230
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1231
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1232
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1233
+
1234
+ result
1235
+ end
1236
+
1237
+ promise.execute
1238
+ end
1239
+
1240
+ #
1241
+ # Downloads the updates on a Data Box Edge/Data Box Gateway device.
1242
+ #
1243
+ # @param device_name [String] The device name.
1244
+ # @param resource_group_name [String] The resource group name.
1245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1246
+ # will be added to the HTTP request.
1247
+ #
1248
+ #
1249
+ def begin_download_updates(device_name, resource_group_name, custom_headers:nil)
1250
+ response = begin_download_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1251
+ nil
1252
+ end
1253
+
1254
+ #
1255
+ # Downloads the updates on a Data Box Edge/Data Box Gateway device.
1256
+ #
1257
+ # @param device_name [String] The device name.
1258
+ # @param resource_group_name [String] The resource group name.
1259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1260
+ # will be added to the HTTP request.
1261
+ #
1262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1263
+ #
1264
+ def begin_download_updates_with_http_info(device_name, resource_group_name, custom_headers:nil)
1265
+ begin_download_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1266
+ end
1267
+
1268
+ #
1269
+ # Downloads the updates on a Data Box Edge/Data Box Gateway device.
1270
+ #
1271
+ # @param device_name [String] The device name.
1272
+ # @param resource_group_name [String] The resource group name.
1273
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1274
+ # to the HTTP request.
1275
+ #
1276
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1277
+ #
1278
+ def begin_download_updates_async(device_name, resource_group_name, custom_headers:nil)
1279
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1280
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1281
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1282
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1283
+
1284
+
1285
+ request_headers = {}
1286
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1287
+
1288
+ # Set Headers
1289
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1290
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1291
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'
1292
+
1293
+ request_url = @base_url || @client.base_url
1294
+
1295
+ options = {
1296
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1297
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1298
+ query_params: {'api-version' => @client.api_version},
1299
+ headers: request_headers.merge(custom_headers || {}),
1300
+ base_url: request_url
1301
+ }
1302
+ promise = @client.make_request_async(:post, path_template, options)
1303
+
1304
+ promise = promise.then do |result|
1305
+ http_response = result.response
1306
+ status_code = http_response.status
1307
+ response_content = http_response.body
1308
+ unless status_code == 200 || status_code == 202
1309
+ error_model = JSON.load(response_content)
1310
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1311
+ end
1312
+
1313
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1314
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1315
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1316
+
1317
+ result
1318
+ end
1319
+
1320
+ promise.execute
1321
+ end
1322
+
1323
+ #
1324
+ # Installs the updates on the Data Box Edge/Data Box Gateway device.
1325
+ #
1326
+ # @param device_name [String] The device name.
1327
+ # @param resource_group_name [String] The resource group name.
1328
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1329
+ # will be added to the HTTP request.
1330
+ #
1331
+ #
1332
+ def begin_install_updates(device_name, resource_group_name, custom_headers:nil)
1333
+ response = begin_install_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1334
+ nil
1335
+ end
1336
+
1337
+ #
1338
+ # Installs the updates on the Data Box Edge/Data Box Gateway device.
1339
+ #
1340
+ # @param device_name [String] The device name.
1341
+ # @param resource_group_name [String] The resource group name.
1342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1343
+ # will be added to the HTTP request.
1344
+ #
1345
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1346
+ #
1347
+ def begin_install_updates_with_http_info(device_name, resource_group_name, custom_headers:nil)
1348
+ begin_install_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1349
+ end
1350
+
1351
+ #
1352
+ # Installs the updates on the Data Box Edge/Data Box Gateway device.
1353
+ #
1354
+ # @param device_name [String] The device name.
1355
+ # @param resource_group_name [String] The resource group name.
1356
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1357
+ # to the HTTP request.
1358
+ #
1359
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1360
+ #
1361
+ def begin_install_updates_async(device_name, resource_group_name, custom_headers:nil)
1362
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1363
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1364
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1365
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1366
+
1367
+
1368
+ request_headers = {}
1369
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1370
+
1371
+ # Set Headers
1372
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1373
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1374
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'
1375
+
1376
+ request_url = @base_url || @client.base_url
1377
+
1378
+ options = {
1379
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1380
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1381
+ query_params: {'api-version' => @client.api_version},
1382
+ headers: request_headers.merge(custom_headers || {}),
1383
+ base_url: request_url
1384
+ }
1385
+ promise = @client.make_request_async(:post, path_template, options)
1386
+
1387
+ promise = promise.then do |result|
1388
+ http_response = result.response
1389
+ status_code = http_response.status
1390
+ response_content = http_response.body
1391
+ unless status_code == 200 || status_code == 202
1392
+ error_model = JSON.load(response_content)
1393
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1394
+ end
1395
+
1396
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1397
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1398
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1399
+
1400
+ result
1401
+ end
1402
+
1403
+ promise.execute
1404
+ end
1405
+
1406
+ #
1407
+ # Scans for updates on a Data Box Edge/Data Box Gateway device.
1408
+ #
1409
+ # @param device_name [String] The device name.
1410
+ # @param resource_group_name [String] The resource group name.
1411
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1412
+ # will be added to the HTTP request.
1413
+ #
1414
+ #
1415
+ def begin_scan_for_updates(device_name, resource_group_name, custom_headers:nil)
1416
+ response = begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1417
+ nil
1418
+ end
1419
+
1420
+ #
1421
+ # Scans for updates on a Data Box Edge/Data Box Gateway device.
1422
+ #
1423
+ # @param device_name [String] The device name.
1424
+ # @param resource_group_name [String] The resource group name.
1425
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1426
+ # will be added to the HTTP request.
1427
+ #
1428
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1429
+ #
1430
+ def begin_scan_for_updates_with_http_info(device_name, resource_group_name, custom_headers:nil)
1431
+ begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1432
+ end
1433
+
1434
+ #
1435
+ # Scans for updates on a Data Box Edge/Data Box Gateway device.
1436
+ #
1437
+ # @param device_name [String] The device name.
1438
+ # @param resource_group_name [String] The resource group name.
1439
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1440
+ # to the HTTP request.
1441
+ #
1442
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1443
+ #
1444
+ def begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:nil)
1445
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1446
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1447
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1448
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1449
+
1450
+
1451
+ request_headers = {}
1452
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1453
+
1454
+ # Set Headers
1455
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1456
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1457
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'
1458
+
1459
+ request_url = @base_url || @client.base_url
1460
+
1461
+ options = {
1462
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1463
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1464
+ query_params: {'api-version' => @client.api_version},
1465
+ headers: request_headers.merge(custom_headers || {}),
1466
+ base_url: request_url
1467
+ }
1468
+ promise = @client.make_request_async(:post, path_template, options)
1469
+
1470
+ promise = promise.then do |result|
1471
+ http_response = result.response
1472
+ status_code = http_response.status
1473
+ response_content = http_response.body
1474
+ unless status_code == 200 || status_code == 202
1475
+ error_model = JSON.load(response_content)
1476
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1477
+ end
1478
+
1479
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1480
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1481
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1482
+
1483
+ result
1484
+ end
1485
+
1486
+ promise.execute
1487
+ end
1488
+
1489
+ #
1490
+ # Updates the security settings on a Data Box Edge/Data Box Gateway device.
1491
+ #
1492
+ # @param device_name [String] The device name.
1493
+ # @param security_settings [SecuritySettings] The security settings.
1494
+ # @param resource_group_name [String] The resource group name.
1495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1496
+ # will be added to the HTTP request.
1497
+ #
1498
+ #
1499
+ def begin_create_or_update_security_settings(device_name, security_settings, resource_group_name, custom_headers:nil)
1500
+ response = begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers).value!
1501
+ nil
1502
+ end
1503
+
1504
+ #
1505
+ # Updates the security settings on a Data Box Edge/Data Box Gateway device.
1506
+ #
1507
+ # @param device_name [String] The device name.
1508
+ # @param security_settings [SecuritySettings] The security settings.
1509
+ # @param resource_group_name [String] The resource group name.
1510
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1511
+ # will be added to the HTTP request.
1512
+ #
1513
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1514
+ #
1515
+ def begin_create_or_update_security_settings_with_http_info(device_name, security_settings, resource_group_name, custom_headers:nil)
1516
+ begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers).value!
1517
+ end
1518
+
1519
+ #
1520
+ # Updates the security settings on a Data Box Edge/Data Box Gateway device.
1521
+ #
1522
+ # @param device_name [String] The device name.
1523
+ # @param security_settings [SecuritySettings] The security settings.
1524
+ # @param resource_group_name [String] The resource group name.
1525
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1526
+ # to the HTTP request.
1527
+ #
1528
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1529
+ #
1530
+ def begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:nil)
1531
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1532
+ fail ArgumentError, 'security_settings is nil' if security_settings.nil?
1533
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1534
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1535
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1536
+
1537
+
1538
+ request_headers = {}
1539
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1540
+
1541
+ # Set Headers
1542
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1543
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1544
+
1545
+ # Serialize Request
1546
+ request_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::SecuritySettings.mapper()
1547
+ request_content = @client.serialize(request_mapper, security_settings)
1548
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1549
+
1550
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'
1551
+
1552
+ request_url = @base_url || @client.base_url
1553
+
1554
+ options = {
1555
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1556
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1557
+ query_params: {'api-version' => @client.api_version},
1558
+ body: request_content,
1559
+ headers: request_headers.merge(custom_headers || {}),
1560
+ base_url: request_url
1561
+ }
1562
+ promise = @client.make_request_async(:post, path_template, options)
1563
+
1564
+ promise = promise.then do |result|
1565
+ http_response = result.response
1566
+ status_code = http_response.status
1567
+ response_content = http_response.body
1568
+ unless status_code == 202 || status_code == 204
1569
+ error_model = JSON.load(response_content)
1570
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1571
+ end
1572
+
1573
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1574
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1575
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1576
+
1577
+ result
1578
+ end
1579
+
1580
+ promise.execute
1581
+ end
1582
+
1583
+ #
1584
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
1585
+ #
1586
+ # @param next_page_link [String] The NextLink from the previous successful call
1587
+ # to List operation.
1588
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1589
+ # will be added to the HTTP request.
1590
+ #
1591
+ # @return [DataBoxEdgeDeviceList] operation results.
1592
+ #
1593
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1594
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1595
+ response.body unless response.nil?
1596
+ end
1597
+
1598
+ #
1599
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
1600
+ #
1601
+ # @param next_page_link [String] The NextLink from the previous successful call
1602
+ # to List operation.
1603
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1604
+ # will be added to the HTTP request.
1605
+ #
1606
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1607
+ #
1608
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1609
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1610
+ end
1611
+
1612
+ #
1613
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
1614
+ #
1615
+ # @param next_page_link [String] The NextLink from the previous successful call
1616
+ # to List operation.
1617
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1618
+ # to the HTTP request.
1619
+ #
1620
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1621
+ #
1622
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1623
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1624
+
1625
+
1626
+ request_headers = {}
1627
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1628
+
1629
+ # Set Headers
1630
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1631
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1632
+ path_template = '{nextLink}'
1633
+
1634
+ request_url = @base_url || @client.base_url
1635
+
1636
+ options = {
1637
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1638
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1639
+ headers: request_headers.merge(custom_headers || {}),
1640
+ base_url: request_url
1641
+ }
1642
+ promise = @client.make_request_async(:get, path_template, options)
1643
+
1644
+ promise = promise.then do |result|
1645
+ http_response = result.response
1646
+ status_code = http_response.status
1647
+ response_content = http_response.body
1648
+ unless status_code == 200
1649
+ error_model = JSON.load(response_content)
1650
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1651
+ end
1652
+
1653
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1654
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1655
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1656
+ # Deserialize Response
1657
+ if status_code == 200
1658
+ begin
1659
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1660
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDeviceList.mapper()
1661
+ result.body = @client.deserialize(result_mapper, parsed_response)
1662
+ rescue Exception => e
1663
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1664
+ end
1665
+ end
1666
+
1667
+ result
1668
+ end
1669
+
1670
+ promise.execute
1671
+ end
1672
+
1673
+ #
1674
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
1675
+ #
1676
+ # @param next_page_link [String] The NextLink from the previous successful call
1677
+ # to List operation.
1678
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1679
+ # will be added to the HTTP request.
1680
+ #
1681
+ # @return [DataBoxEdgeDeviceList] operation results.
1682
+ #
1683
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1684
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1685
+ response.body unless response.nil?
1686
+ end
1687
+
1688
+ #
1689
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
1690
+ #
1691
+ # @param next_page_link [String] The NextLink from the previous successful call
1692
+ # to List operation.
1693
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1694
+ # will be added to the HTTP request.
1695
+ #
1696
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1697
+ #
1698
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1699
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1700
+ end
1701
+
1702
+ #
1703
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
1704
+ #
1705
+ # @param next_page_link [String] The NextLink from the previous successful call
1706
+ # to List operation.
1707
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1708
+ # to the HTTP request.
1709
+ #
1710
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1711
+ #
1712
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1713
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1714
+
1715
+
1716
+ request_headers = {}
1717
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1718
+
1719
+ # Set Headers
1720
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1721
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1722
+ path_template = '{nextLink}'
1723
+
1724
+ request_url = @base_url || @client.base_url
1725
+
1726
+ options = {
1727
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1728
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1729
+ headers: request_headers.merge(custom_headers || {}),
1730
+ base_url: request_url
1731
+ }
1732
+ promise = @client.make_request_async(:get, path_template, options)
1733
+
1734
+ promise = promise.then do |result|
1735
+ http_response = result.response
1736
+ status_code = http_response.status
1737
+ response_content = http_response.body
1738
+ unless status_code == 200
1739
+ error_model = JSON.load(response_content)
1740
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1741
+ end
1742
+
1743
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1744
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1745
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1746
+ # Deserialize Response
1747
+ if status_code == 200
1748
+ begin
1749
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1750
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::DataBoxEdgeDeviceList.mapper()
1751
+ result.body = @client.deserialize(result_mapper, parsed_response)
1752
+ rescue Exception => e
1753
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1754
+ end
1755
+ end
1756
+
1757
+ result
1758
+ end
1759
+
1760
+ promise.execute
1761
+ end
1762
+
1763
+ #
1764
+ # Gets all the Data Box Edge/Data Box Gateway devices in a subscription.
1765
+ #
1766
+ # @param expand [String] Specify $expand=details to populate additional fields
1767
+ # related to the resource or Specify $skipToken=<token> to populate the next
1768
+ # page in the list.
1769
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1770
+ # will be added to the HTTP request.
1771
+ #
1772
+ # @return [DataBoxEdgeDeviceList] which provide lazy access to pages of the
1773
+ # response.
1774
+ #
1775
+ def list_by_subscription_as_lazy(expand:nil, custom_headers:nil)
1776
+ response = list_by_subscription_async(expand:expand, custom_headers:custom_headers).value!
1777
+ unless response.nil?
1778
+ page = response.body
1779
+ page.next_method = Proc.new do |next_page_link|
1780
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1781
+ end
1782
+ page
1783
+ end
1784
+ end
1785
+
1786
+ #
1787
+ # Gets all the Data Box Edge/Data Box Gateway devices in a resource group.
1788
+ #
1789
+ # @param resource_group_name [String] The resource group name.
1790
+ # @param expand [String] Specify $expand=details to populate additional fields
1791
+ # related to the resource or Specify $skipToken=<token> to populate the next
1792
+ # page in the list.
1793
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1794
+ # will be added to the HTTP request.
1795
+ #
1796
+ # @return [DataBoxEdgeDeviceList] which provide lazy access to pages of the
1797
+ # response.
1798
+ #
1799
+ def list_by_resource_group_as_lazy(resource_group_name, expand:nil, custom_headers:nil)
1800
+ response = list_by_resource_group_async(resource_group_name, expand:expand, custom_headers:custom_headers).value!
1801
+ unless response.nil?
1802
+ page = response.body
1803
+ page.next_method = Proc.new do |next_page_link|
1804
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1805
+ end
1806
+ page
1807
+ end
1808
+ end
1809
+
1810
+ end
1811
+ end