Class: Azure::ServiceFabric::V6_4_0_36::MeshVolume
- Inherits:
-
Object
- Object
- Azure::ServiceFabric::V6_4_0_36::MeshVolume
- Includes:
- MsRestAzure
- Defined in:
- lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb
Overview
Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services.
Instance Attribute Summary collapse
-
#client ⇒ ServiceFabricClientAPIs
readonly
Reference to the ServiceFabricClientAPIs.
Instance Method Summary collapse
-
#create_or_update(volume_resource_name, volume_resource_description, custom_headers: nil) ⇒ VolumeResourceDescription
Creates or updates a Volume resource.
-
#create_or_update_async(volume_resource_name, volume_resource_description, custom_headers: nil) ⇒ Concurrent::Promise
Creates or updates a Volume resource.
-
#create_or_update_with_http_info(volume_resource_name, volume_resource_description, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates or updates a Volume resource.
-
#delete(volume_resource_name, custom_headers: nil) ⇒ Object
Deletes the Volume resource.
-
#delete_async(volume_resource_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the Volume resource.
-
#delete_with_http_info(volume_resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the Volume resource.
-
#get(volume_resource_name, custom_headers: nil) ⇒ VolumeResourceDescription
Gets the Volume resource with the given name.
-
#get_async(volume_resource_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets the Volume resource with the given name.
-
#get_with_http_info(volume_resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the Volume resource with the given name.
-
#initialize(client) ⇒ MeshVolume
constructor
Creates and initializes a new instance of the MeshVolume class.
-
#list(custom_headers: nil) ⇒ PagedVolumeResourceDescriptionList
Lists all the volume resources.
-
#list_async(custom_headers: nil) ⇒ Concurrent::Promise
Lists all the volume resources.
-
#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all the volume resources.
Constructor Details
#initialize(client) ⇒ MeshVolume
Creates and initializes a new instance of the MeshVolume class.
18 19 20 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 18 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ServiceFabricClientAPIs (readonly)
Returns reference to the ServiceFabricClientAPIs.
23 24 25 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 23 def client @client end |
Instance Method Details
#create_or_update(volume_resource_name, volume_resource_description, custom_headers: nil) ⇒ VolumeResourceDescription
Creates or updates a Volume resource.
Creates a Volume resource with the specified name, description and properties. If Volume resource with the same name exists, then it is updated with the specified description and properties.
for creating a Volume resource. will be added to the HTTP request.
40 41 42 43 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 40 def create_or_update(volume_resource_name, volume_resource_description, custom_headers:nil) response = create_or_update_async(volume_resource_name, volume_resource_description, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(volume_resource_name, volume_resource_description, custom_headers: nil) ⇒ Concurrent::Promise
Creates or updates a Volume resource.
Creates a Volume resource with the specified name, description and properties. If Volume resource with the same name exists, then it is updated with the specified description and properties.
for creating a Volume resource. to the HTTP request.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 79 def create_or_update_async(volume_resource_name, volume_resource_description, custom_headers:nil) api_version = '6.4-preview' fail ArgumentError, 'volume_resource_name is nil' if volume_resource_name.nil? fail ArgumentError, 'volume_resource_description is nil' if volume_resource_description.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::ServiceFabric::V6_4_0_36::Models::VolumeResourceDescription.mapper() request_content = @client.serialize(request_mapper, volume_resource_description) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'Resources/Volumes/{volumeResourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'volumeResourceName' => volume_resource_name}, query_params: {'api-version' => api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 201 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServiceFabric::V6_4_0_36::Models::VolumeResourceDescription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServiceFabric::V6_4_0_36::Models::VolumeResourceDescription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#create_or_update_with_http_info(volume_resource_name, volume_resource_description, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates or updates a Volume resource.
Creates a Volume resource with the specified name, description and properties. If Volume resource with the same name exists, then it is updated with the specified description and properties.
for creating a Volume resource. will be added to the HTTP request.
60 61 62 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 60 def create_or_update_with_http_info(volume_resource_name, volume_resource_description, custom_headers:nil) create_or_update_async(volume_resource_name, volume_resource_description, custom_headers:custom_headers).value! end |
#delete(volume_resource_name, custom_headers: nil) ⇒ Object
Deletes the Volume resource.
Deletes the Volume resource identified by the name.
will be added to the HTTP request.
258 259 260 261 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 258 def delete(volume_resource_name, custom_headers:nil) response = delete_async(volume_resource_name, custom_headers:custom_headers).value! nil end |
#delete_async(volume_resource_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the Volume resource.
Deletes the Volume resource identified by the name.
to the HTTP request.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 289 def delete_async(volume_resource_name, custom_headers:nil) api_version = '6.4-preview' fail ArgumentError, 'volume_resource_name is nil' if volume_resource_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'Resources/Volumes/{volumeResourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'volumeResourceName' => volume_resource_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 || status_code == 204 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#delete_with_http_info(volume_resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the Volume resource.
Deletes the Volume resource identified by the name.
will be added to the HTTP request.
274 275 276 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 274 def delete_with_http_info(volume_resource_name, custom_headers:nil) delete_async(volume_resource_name, custom_headers:custom_headers).value! end |
#get(volume_resource_name, custom_headers: nil) ⇒ VolumeResourceDescription
Gets the Volume resource with the given name.
Gets the information about the Volume resource with the given name. The information include the description and other properties of the Volume.
will be added to the HTTP request.
162 163 164 165 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 162 def get(volume_resource_name, custom_headers:nil) response = get_async(volume_resource_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(volume_resource_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets the Volume resource with the given name.
Gets the information about the Volume resource with the given name. The information include the description and other properties of the Volume.
to the HTTP request.
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 195 def get_async(volume_resource_name, custom_headers:nil) api_version = '6.4-preview' fail ArgumentError, 'volume_resource_name is nil' if volume_resource_name.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'Resources/Volumes/{volumeResourceName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'volumeResourceName' => volume_resource_name}, query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServiceFabric::V6_4_0_36::Models::VolumeResourceDescription.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_with_http_info(volume_resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the Volume resource with the given name.
Gets the information about the Volume resource with the given name. The information include the description and other properties of the Volume.
will be added to the HTTP request.
179 180 181 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 179 def get_with_http_info(volume_resource_name, custom_headers:nil) get_async(volume_resource_name, custom_headers:custom_headers).value! end |
#list(custom_headers: nil) ⇒ PagedVolumeResourceDescriptionList
Lists all the volume resources.
Gets the information about all volume resources in a given resource group. The information include the description and other properties of the Volume.
will be added to the HTTP request.
343 344 345 346 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 343 def list(custom_headers:nil) response = list_async(custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_async(custom_headers: nil) ⇒ Concurrent::Promise
Lists all the volume resources.
Gets the information about all volume resources in a given resource group. The information include the description and other properties of the Volume.
to the HTTP request.
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 374 def list_async(custom_headers:nil) api_version = '6.4-preview' request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'Resources/Volumes' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'api-version' => api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServiceFabric::V6_4_0_36::Models::PagedVolumeResourceDescriptionList.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all the volume resources.
Gets the information about all volume resources in a given resource group. The information include the description and other properties of the Volume.
will be added to the HTTP request.
359 360 361 |
# File 'lib/6.4.0.36/generated/azure_service_fabric/mesh_volume.rb', line 359 def list_with_http_info(custom_headers:nil) list_async(custom_headers:custom_headers).value! end |