Class: Azure::Synapse::Mgmt::V2019_06_01_preview::Operations

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb

Overview

Azure Synapse Analytics Management Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Operations

Creates and initializes a new instance of the Operations class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientSynapseManagementClient (readonly)

Returns reference to the SynapseManagementClient.

Returns:



22
23
24
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 22

def client
  @client
end

Instance Method Details

#check_name_availability(request, custom_headers: nil) ⇒ CheckNameAvailabilityResponse

Check name availability

Check whether a workspace name is available

will be added to the HTTP request.

Parameters:

  • request (CheckNameAvailabilityRequest)

    The check request

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (CheckNameAvailabilityResponse)

    operation results.



35
36
37
38
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 35

def check_name_availability(request, custom_headers:nil)
  response = check_name_availability_async(request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(request, custom_headers: nil) ⇒ Concurrent::Promise

Check name availability

Check whether a workspace name is available

to the HTTP request.

Parameters:

  • request (CheckNameAvailabilityRequest)

    The check request

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



66
67
68
69
70
71
72
73
74
75
76
77
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
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 66

def check_name_availability_async(request, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'request is nil' if request.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::Synapse::Mgmt::V2019_06_01_preview::Models::CheckNameAvailabilityRequest.mapper()
  request_content = @client.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Synapse/checkNameAvailability'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  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::Synapse::Mgmt::V2019_06_01_preview::Models::CheckNameAvailabilityResponse.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#check_name_availability_with_http_info(request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Check name availability

Check whether a workspace name is available

will be added to the HTTP request.

Parameters:

  • request (CheckNameAvailabilityRequest)

    The check request

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



51
52
53
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 51

def check_name_availability_with_http_info(request, custom_headers:nil)
  check_name_availability_async(request, custom_headers:custom_headers).value!
end

#get_azure_async_header_result(resource_group_name, workspace_name, operation_id, custom_headers: nil) ⇒ OperationResource

Get operation status

Get the status of an operation

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • workspace_name (String)

    The name of the workspace

  • operation_id (String)

    Operation ID

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (OperationResource)

    operation results.



348
349
350
351
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 348

def get_azure_async_header_result(resource_group_name, workspace_name, operation_id, custom_headers:nil)
  response = get_azure_async_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_azure_async_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers: nil) ⇒ Concurrent::Promise

Get operation status

Get the status of an operation

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • workspace_name (String)

    The name of the workspace

  • operation_id (String)

    Operation ID

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 385

def get_azure_async_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  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, 'operation_id is nil' if operation_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.Synapse/workspaces/{workspaceName}/operationStatuses/{operationId}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'operationId' => operation_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, options)

  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 == 404
      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::Synapse::Mgmt::V2019_06_01_preview::Models::OperationResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_azure_async_header_result_with_http_info(resource_group_name, workspace_name, operation_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get operation status

Get the status of an operation

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • workspace_name (String)

    The name of the workspace

  • operation_id (String)

    Operation ID

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



367
368
369
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 367

def get_azure_async_header_result_with_http_info(resource_group_name, workspace_name, operation_id, custom_headers:nil)
  get_azure_async_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers:custom_headers).value!
end

#get_location_header_result(resource_group_name, workspace_name, operation_id, custom_headers: nil) ⇒ Object

Get operation result

Get the result of an operation

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • workspace_name (String)

    The name of the workspace

  • operation_id (String)

    Operation ID

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



246
247
248
249
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 246

def get_location_header_result(resource_group_name, workspace_name, operation_id, custom_headers:nil)
  response = get_location_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers:custom_headers).value!
  nil
end

#get_location_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers: nil) ⇒ Concurrent::Promise

Get operation result

Get the result of an operation

is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • workspace_name (String)

    The name of the workspace

  • operation_id (String)

    Operation ID

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



283
284
285
286
287
288
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
331
332
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 283

def get_location_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  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, 'operation_id is nil' if operation_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.Synapse/workspaces/{workspaceName}/operationResults/{operationId}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'workspaceName' => workspace_name,'operationId' => operation_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, options)

  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 || 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

#get_location_header_result_with_http_info(resource_group_name, workspace_name, operation_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get operation result

Get the result of an operation

is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group. The name

  • workspace_name (String)

    The name of the workspace

  • operation_id (String)

    Operation ID

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



265
266
267
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 265

def get_location_header_result_with_http_info(resource_group_name, workspace_name, operation_id, custom_headers:nil)
  get_location_header_result_async(resource_group_name, workspace_name, operation_id, custom_headers:custom_headers).value!
end

#list(custom_headers: nil) ⇒ Array

All operations

Get all available operations

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



139
140
141
142
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 139

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

All operations

Get all available operations

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
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
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 168

def list_async(custom_headers: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 = 'providers/Microsoft.Synapse/operations'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  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 = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'AvailableRpOperationElementType',
                type: {
                  name: 'Composite',
                  class_name: 'AvailableRpOperation'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

All operations

Get all available operations

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



154
155
156
# File 'lib/2019-06-01-preview/generated/azure_mgmt_synapse/operations.rb', line 154

def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end