Class: Azure::BatchAI::Mgmt::V2018_05_01::Experiments
- Inherits:
-
Object
- Object
- Azure::BatchAI::Mgmt::V2018_05_01::Experiments
- Includes:
- MsRestAzure
- Defined in:
- lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb
Overview
The Azure BatchAI Management API.
Instance Attribute Summary collapse
-
#client ⇒ BatchAIManagementClient
readonly
Reference to the BatchAIManagementClient.
Instance Method Summary collapse
-
#begin_create(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Experiment
Creates an Experiment.
-
#begin_create_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
Creates an Experiment.
-
#begin_create_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates an Experiment.
-
#begin_delete(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Object
Deletes an Experiment.
-
#begin_delete_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes an Experiment.
-
#begin_delete_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes an Experiment.
-
#create(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Experiment
Creates an Experiment.
-
#create_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
resource belongs.
-
#delete(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Object
Deletes an Experiment.
-
#delete_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
resource belongs.
-
#get(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Experiment
Gets information about an Experiment.
-
#get_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets information about an Experiment.
-
#get_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets information about an Experiment.
-
#initialize(client) ⇒ Experiments
constructor
Creates and initializes a new instance of the Experiments class.
-
#list_by_workspace(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ Array<Experiment>
Gets a list of Experiments within the specified Workspace.
-
#list_by_workspace_as_lazy(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ ExperimentListResult
Gets a list of Experiments within the specified Workspace.
-
#list_by_workspace_async(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets a list of Experiments within the specified Workspace.
-
#list_by_workspace_next(next_page_link, custom_headers: nil) ⇒ ExperimentListResult
Gets a list of Experiments within the specified Workspace.
-
#list_by_workspace_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Gets a list of Experiments within the specified Workspace.
-
#list_by_workspace_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of Experiments within the specified Workspace.
-
#list_by_workspace_with_http_info(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of Experiments within the specified Workspace.
Constructor Details
#initialize(client) ⇒ Experiments
Creates and initializes a new instance of the Experiments class.
17 18 19 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ BatchAIManagementClient (readonly)
Returns reference to the BatchAIManagementClient.
22 23 24 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 22 def client @client end |
Instance Method Details
#begin_create(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Experiment
Creates an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
381 382 383 384 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 381 def begin_create(resource_group_name, workspace_name, experiment_name, custom_headers:nil) response = begin_create_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
Creates an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. to the HTTP request.
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 422 def begin_create_async(resource_group_name, workspace_name, experiment_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '64'" if !workspace_name.nil? && workspace_name.length > 64 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, 'experiment_name is nil' if experiment_name.nil? fail ArgumentError, "'experiment_name' should satisfy the constraint - 'MaxLength': '64'" if !experiment_name.nil? && experiment_name.length > 64 fail ArgumentError, "'experiment_name' should satisfy the constraint - 'MinLength': '1'" if !experiment_name.nil? && experiment_name.length < 1 fail ArgumentError, "'experiment_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !experiment_name.nil? && experiment_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'experimentName' => experiment_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, 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 == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.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::BatchAI::Mgmt::V2018_05_01::Models::Experiment.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 |
#begin_create_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
402 403 404 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 402 def begin_create_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers:nil) begin_create_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Object
Deletes an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
500 501 502 503 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 500 def begin_delete(resource_group_name, workspace_name, experiment_name, custom_headers:nil) response = begin_delete_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. to the HTTP request.
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 541 def begin_delete_async(resource_group_name, workspace_name, experiment_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '64'" if !workspace_name.nil? && workspace_name.length > 64 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, 'experiment_name is nil' if experiment_name.nil? fail ArgumentError, "'experiment_name' should satisfy the constraint - 'MaxLength': '64'" if !experiment_name.nil? && experiment_name.length > 64 fail ArgumentError, "'experiment_name' should satisfy the constraint - 'MinLength': '1'" if !experiment_name.nil? && experiment_name.length < 1 fail ArgumentError, "'experiment_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !experiment_name.nil? && experiment_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'experimentName' => experiment_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.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 MsRestAzure::AzureOperationError.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 |
#begin_delete_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
521 522 523 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 521 def begin_delete_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers:nil) begin_delete_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! end |
#create(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Experiment
Creates an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
157 158 159 160 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 157 def create(resource_group_name, workspace_name, experiment_name, custom_headers:nil) response = create_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
response.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 177 def create_async(resource_group_name, workspace_name, experiment_name, custom_headers:nil) # Send request promise = begin_create_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::BatchAI::Mgmt::V2018_05_01::Models::Experiment.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#delete(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Object
Deletes an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
209 210 211 212 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 209 def delete(resource_group_name, workspace_name, experiment_name, custom_headers:nil) response = delete_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
response.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 229 def delete_async(resource_group_name, workspace_name, experiment_name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Experiment
Gets information about an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
261 262 263 264 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 261 def get(resource_group_name, workspace_name, experiment_name, custom_headers:nil) response = get_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets information about an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. to the HTTP request.
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 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 302 def get_async(resource_group_name, workspace_name, experiment_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '64'" if !workspace_name.nil? && workspace_name.length > 64 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, 'experiment_name is nil' if experiment_name.nil? fail ArgumentError, "'experiment_name' should satisfy the constraint - 'MaxLength': '64'" if !experiment_name.nil? && experiment_name.length > 64 fail ArgumentError, "'experiment_name' should satisfy the constraint - 'MinLength': '1'" if !experiment_name.nil? && experiment_name.length < 1 fail ArgumentError, "'experiment_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !experiment_name.nil? && experiment_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments/{experimentName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'experimentName' => experiment_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.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 MsRestAzure::AzureOperationError.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::BatchAI::Mgmt::V2018_05_01::Models::Experiment.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(resource_group_name, workspace_name, experiment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets information about an Experiment.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long. will be added to the HTTP request.
282 283 284 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 282 def get_with_http_info(resource_group_name, workspace_name, experiment_name, custom_headers:nil) get_async(resource_group_name, workspace_name, experiment_name, custom_headers:custom_headers).value! end |
#list_by_workspace(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ Array<Experiment>
Gets a list of Experiments within the specified Workspace.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- ExperimentsListByWorkspaceOptions
-
Additional parameters for the operation
will be added to the HTTP request.
39 40 41 42 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 39 def list_by_workspace(resource_group_name, workspace_name, experiments_list_by_workspace_options:nil, custom_headers:nil) first_page = list_by_workspace_as_lazy(resource_group_name, workspace_name, experiments_list_by_workspace_options:, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_workspace_as_lazy(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ ExperimentListResult
Gets a list of Experiments within the specified Workspace.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- ExperimentsListByWorkspaceOptions
-
Additional parameters for the operation
will be added to the HTTP request.
response.
700 701 702 703 704 705 706 707 708 709 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 700 def list_by_workspace_as_lazy(resource_group_name, workspace_name, experiments_list_by_workspace_options:nil, custom_headers:nil) response = list_by_workspace_async(resource_group_name, workspace_name, experiments_list_by_workspace_options:, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_workspace_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_workspace_async(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets a list of Experiments within the specified Workspace.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- ExperimentsListByWorkspaceOptions
-
Additional parameters for the operation
to the HTTP request.
78 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 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 78 def list_by_workspace_async(resource_group_name, workspace_name, experiments_list_by_workspace_options:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'workspace_name is nil' if workspace_name.nil? fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MaxLength': '64'" if !workspace_name.nil? && workspace_name.length > 64 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'MinLength': '1'" if !workspace_name.nil? && workspace_name.length < 1 fail ArgumentError, "'workspace_name' should satisfy the constraint - 'Pattern': '^[-\w_]+$'" if !workspace_name.nil? && workspace_name.match(Regexp.new('^^[-\w_]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? max_results = nil unless .nil? max_results = .maxResults end 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces/{workspaceName}/experiments' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version,'maxresults' => max_results}, 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 MsRestAzure::AzureOperationError.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::BatchAI::Mgmt::V2018_05_01::Models::ExperimentListResult.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_by_workspace_next(next_page_link, custom_headers: nil) ⇒ ExperimentListResult
Gets a list of Experiments within the specified Workspace.
to List operation. will be added to the HTTP request.
604 605 606 607 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 604 def list_by_workspace_next(next_page_link, custom_headers:nil) response = list_by_workspace_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_workspace_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Gets a list of Experiments within the specified Workspace.
to List operation. to the HTTP request.
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 633 def list_by_workspace_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, 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 MsRestAzure::AzureOperationError.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::BatchAI::Mgmt::V2018_05_01::Models::ExperimentListResult.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_by_workspace_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of Experiments within the specified Workspace.
to List operation. will be added to the HTTP request.
619 620 621 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 619 def list_by_workspace_next_with_http_info(next_page_link, custom_headers:nil) list_by_workspace_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_workspace_with_http_info(resource_group_name, workspace_name, experiments_list_by_workspace_options: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of Experiments within the specified Workspace.
resource belongs. only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
- ExperimentsListByWorkspaceOptions
-
Additional parameters for the operation
will be added to the HTTP request.
59 60 61 |
# File 'lib/2018-05-01/generated/azure_mgmt_batchai/experiments.rb', line 59 def list_by_workspace_with_http_info(resource_group_name, workspace_name, experiments_list_by_workspace_options:nil, custom_headers:nil) list_by_workspace_async(resource_group_name, workspace_name, experiments_list_by_workspace_options:, custom_headers:custom_headers).value! end |