Class: Azure::IotHub::Mgmt::V2018_01_22::IotHubResource

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb

Overview

Use this API to manage the IoT hubs in your Azure subscription.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ IotHubResource

Creates and initializes a new instance of the IotHubResource class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientIotHubClient (readonly)

Returns reference to the IotHubClient.

Returns:



22
23
24
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, resource_name, iot_hub_description, if_match: nil, custom_headers: nil) ⇒ IotHubDescription

Create or update the metadata of an IoT hub.

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub.

contains the IoT hub. security metadata. brand new IoT Hub. Required to update an existing IoT Hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

  • if_match (String) (defaults to: nil)

    ETag of the IoT Hub. Do not specify for creating a

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



2065
2066
2067
2068
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2065

def begin_create_or_update(resource_group_name, resource_name, iot_hub_description, if_match:nil, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match:if_match, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match: nil, custom_headers: nil) ⇒ Concurrent::Promise

Create or update the metadata of an IoT hub.

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub.

contains the IoT hub. security metadata. brand new IoT Hub. Required to update an existing IoT Hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

  • if_match (String) (defaults to: nil)

    ETag of the IoT Hub. Do not specify for creating a

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2112

def begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match:nil, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'iot_hub_description is nil' if iot_hub_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['If-Match'] = if_match unless if_match.nil?
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.mapper()
  request_content = @client.serialize(request_mapper,  iot_hub_description)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'

  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,'resourceName' => resource_name},
      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(:put, 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 == 201 || 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 == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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

#begin_create_or_update_with_http_info(resource_group_name, resource_name, iot_hub_description, if_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update the metadata of an IoT hub.

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub.

contains the IoT hub. security metadata. brand new IoT Hub. Required to update an existing IoT Hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

  • if_match (String) (defaults to: nil)

    ETag of the IoT Hub. Do not specify for creating a

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2089
2090
2091
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2089

def begin_create_or_update_with_http_info(resource_group_name, resource_name, iot_hub_description, if_match:nil, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match:if_match, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, resource_name, custom_headers: nil) ⇒ Object

Delete an IoT hub.

Delete an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



2316
2317
2318
2319
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2316

def begin_delete(resource_group_name, resource_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_delete_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Delete an IoT hub.

Delete an IoT hub.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2351

def begin_delete_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'

  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,'resourceName' => resource_name},
      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, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 200 || status_code == 204 || 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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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
    # Deserialize Response
    if status_code == 404
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::ErrorDetails.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

#begin_delete_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete an IoT hub.

Delete an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2334
2335
2336
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2334

def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, resource_name, iot_hub_tags, custom_headers: nil) ⇒ IotHubDescription

Update an existing IoT Hubs tags.

Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method

iot hub instance. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Resource group identifier.

  • resource_name (String)

    Name of iot hub to update.

  • iot_hub_tags (TagsResource)

    Updated tag information to set into the

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



2201
2202
2203
2204
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2201

def begin_update(resource_group_name, resource_name, iot_hub_tags, custom_headers:nil)
  response = begin_update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers: nil) ⇒ Concurrent::Promise

Update an existing IoT Hubs tags.

Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method

iot hub instance. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Resource group identifier.

  • resource_name (String)

    Name of iot hub to update.

  • iot_hub_tags (TagsResource)

    Updated tag information to set into the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2240

def begin_update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'iot_hub_tags is nil' if iot_hub_tags.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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::IotHub::Mgmt::V2018_01_22::Models::TagsResource.mapper()
  request_content = @client.serialize(request_mapper,  iot_hub_tags)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'

  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,'resourceName' => resource_name},
      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(:patch, 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 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::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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

#begin_update_with_http_info(resource_group_name, resource_name, iot_hub_tags, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update an existing IoT Hubs tags.

Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method

iot hub instance. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Resource group identifier.

  • resource_name (String)

    Name of iot hub to update.

  • iot_hub_tags (TagsResource)

    Updated tag information to set into the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2221
2222
2223
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2221

def begin_update_with_http_info(resource_group_name, resource_name, iot_hub_tags, custom_headers:nil)
  begin_update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers:custom_headers).value!
end

#check_name_availability(operation_inputs, custom_headers: nil) ⇒ IotHubNameAvailabilityInfo

Check if an IoT hub name is available.

Check if an IoT hub name is available.

OperationInputs structure to the name of the IoT hub to check. will be added to the HTTP request.

Parameters:

  • operation_inputs (OperationInputs)

    Set the name parameter in the

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

    A hash of custom headers that

Returns:

  • (IotHubNameAvailabilityInfo)

    operation results.



1472
1473
1474
1475
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1472

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

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

Check if an IoT hub name is available.

Check if an IoT hub name is available.

OperationInputs structure to the name of the IoT hub to check. to the HTTP request.

Parameters:

  • operation_inputs (OperationInputs)

    Set the name parameter in the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1505

def check_name_availability_async(operation_inputs, custom_headers: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?
  fail ArgumentError, 'operation_inputs is nil' if operation_inputs.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::IotHub::Mgmt::V2018_01_22::Models::OperationInputs.mapper()
  request_content = @client.serialize(request_mapper,  operation_inputs)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Devices/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::IotHub::Mgmt::V2018_01_22::Models::IotHubNameAvailabilityInfo.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(operation_inputs, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Check if an IoT hub name is available.

Check if an IoT hub name is available.

OperationInputs structure to the name of the IoT hub to check. will be added to the HTTP request.

Parameters:

  • operation_inputs (OperationInputs)

    Set the name parameter in the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1489
1490
1491
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1489

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

#create_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ EventHubConsumerGroupInfo

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

contains the IoT hub. endpoint in the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to add.

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

    A hash of custom headers that

Returns:

  • (EventHubConsumerGroupInfo)

    operation results.



934
935
936
937
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 934

def create_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:nil)
  response = create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

contains the IoT hub. endpoint in the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to add.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 975

def create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
  fail ArgumentError, 'name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'

  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,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name,'name' => name},
      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, 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::IotHub::Mgmt::V2018_01_22::Models::EventHubConsumerGroupInfo.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

#create_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.

contains the IoT hub. endpoint in the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to add.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



955
956
957
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 955

def create_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:nil)
  create_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, resource_name, iot_hub_description, if_match: nil, custom_headers: nil) ⇒ IotHubDescription

Create or update the metadata of an IoT hub.

Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub.

contains the IoT hub. security metadata. brand new IoT Hub. Required to update an existing IoT Hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

  • if_match (String) (defaults to: nil)

    ETag of the IoT Hub. Do not specify for creating a

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



146
147
148
149
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 146

def create_or_update(resource_group_name, resource_name, iot_hub_description, if_match:nil, custom_headers:nil)
  response = create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match:if_match, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match: nil, custom_headers: nil) ⇒ Concurrent::Promise

contains the IoT hub. security metadata. brand new IoT Hub. Required to update an existing IoT Hub. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

  • if_match (String) (defaults to: nil)

    ETag of the IoT Hub. Do not specify for creating a

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 165

def create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match:nil, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, if_match:if_match, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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, resource_name, custom_headers: nil) ⇒ Object

Delete an IoT hub.

Delete an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



245
246
247
248
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 245

def delete(resource_group_name, resource_name, custom_headers:nil)
  response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

contains the IoT hub. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 260

def delete_async(resource_group_name, resource_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        client_side_validation: true,
        required: false,
        serialized_name: 'parsed_response',
        type: {
          name: 'Object'
        }
      }
      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_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ Object

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

contains the IoT hub. endpoint in the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to delete.

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

    A hash of custom headers that



1047
1048
1049
1050
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1047

def delete_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:nil)
  response = delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:custom_headers).value!
  nil
end

#delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

contains the IoT hub. endpoint in the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to delete.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1088

def delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
  fail ArgumentError, 'name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'

  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,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name,'name' => name},
      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, 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?

    result
  end

  promise.execute
end

#delete_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub.

contains the IoT hub. endpoint in the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to delete.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1068
1069
1070
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1068

def delete_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:nil)
  delete_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:custom_headers).value!
end

#export_devices(resource_group_name, resource_name, export_devices_parameters, custom_headers: nil) ⇒ JobResponse

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

contains the IoT hub. specify the export devices operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • export_devices_parameters (ExportDevicesRequest)

    The parameters that

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

    A hash of custom headers that

Returns:

  • (JobResponse)

    operation results.



1807
1808
1809
1810
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1807

def export_devices(resource_group_name, resource_name, export_devices_parameters, custom_headers:nil)
  response = export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

contains the IoT hub. specify the export devices operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • export_devices_parameters (ExportDevicesRequest)

    The parameters that

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1854

def export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'export_devices_parameters is nil' if export_devices_parameters.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::IotHub::Mgmt::V2018_01_22::Models::ExportDevicesRequest.mapper()
  request_content = @client.serialize(request_mapper,  export_devices_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices'

  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,'resourceName' => resource_name},
      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::IotHub::Mgmt::V2018_01_22::Models::JobResponse.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

#export_devices_with_http_info(resource_group_name, resource_name, export_devices_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

contains the IoT hub. specify the export devices operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • export_devices_parameters (ExportDevicesRequest)

    The parameters that

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1831
1832
1833
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1831

def export_devices_with_http_info(resource_group_name, resource_name, export_devices_parameters, custom_headers:nil)
  export_devices_async(resource_group_name, resource_name, export_devices_parameters, custom_headers:custom_headers).value!
end

#get(resource_group_name, resource_name, custom_headers: nil) ⇒ IotHubDescription

Get the non-security related metadata of an IoT hub.

Get the non-security related metadata of an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



37
38
39
40
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 37

def get(resource_group_name, resource_name, custom_headers:nil)
  response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Get the non-security related metadata of an IoT hub.

Get the non-security related metadata of an IoT hub.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 72

def get_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}'

  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,'resourceName' => resource_name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ EventHubConsumerGroupInfo

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

contains the IoT hub. endpoint in the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to retrieve.

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

    A hash of custom headers that

Returns:

  • (EventHubConsumerGroupInfo)

    operation results.



816
817
818
819
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 816

def get_event_hub_consumer_group(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:nil)
  response = get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

contains the IoT hub. endpoint in the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to retrieve.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 861

def get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_name.nil?
  fail ArgumentError, 'name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}'

  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,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name,'name' => name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::EventHubConsumerGroupInfo.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_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.

contains the IoT hub. endpoint in the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • name (String)

    The name of the consumer group to retrieve.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



839
840
841
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 839

def get_event_hub_consumer_group_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:nil)
  get_event_hub_consumer_group_async(resource_group_name, resource_name, event_hub_endpoint_name, name, custom_headers:custom_headers).value!
end

#get_job(resource_group_name, resource_name, job_id, custom_headers: nil) ⇒ JobResponse

Get the details of a job from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get the details of a job from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • job_id (String)

    The job identifier.

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

    A hash of custom headers that

Returns:

  • (JobResponse)

    operation results.



1260
1261
1262
1263
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1260

def get_job(resource_group_name, resource_name, job_id, custom_headers:nil)
  response = get_job_async(resource_group_name, resource_name, job_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_job_async(resource_group_name, resource_name, job_id, custom_headers: nil) ⇒ Concurrent::Promise

Get the details of a job from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get the details of a job from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • job_id (String)

    The job identifier.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1301

def get_job_async(resource_group_name, resource_name, job_id, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'job_id is nil' if job_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.Devices/IotHubs/{resourceName}/jobs/{jobId}'

  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,'resourceName' => resource_name,'jobId' => job_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
      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::IotHub::Mgmt::V2018_01_22::Models::JobResponse.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_job_with_http_info(resource_group_name, resource_name, job_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the details of a job from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get the details of a job from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • job_id (String)

    The job identifier.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1281
1282
1283
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1281

def get_job_with_http_info(resource_group_name, resource_name, job_id, custom_headers:nil)
  get_job_async(resource_group_name, resource_name, job_id, custom_headers:custom_headers).value!
end

#get_keys_for_key_name(resource_group_name, resource_name, key_name, custom_headers: nil) ⇒ SharedAccessSignatureAuthorizationRule

Get a shared access policy by name from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get a shared access policy by name from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • key_name (String)

    The name of the shared access policy.

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

    A hash of custom headers that

Returns:

  • (SharedAccessSignatureAuthorizationRule)

    operation results.



1691
1692
1693
1694
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1691

def get_keys_for_key_name(resource_group_name, resource_name, key_name, custom_headers:nil)
  response = get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a shared access policy by name from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get a shared access policy by name from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • key_name (String)

    The name of the shared access policy.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1732

def get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'key_name is nil' if key_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys'

  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,'resourceName' => resource_name,'keyName' => key_name},
      query_params: {'api-version' => @client.api_version},
      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::IotHub::Mgmt::V2018_01_22::Models::SharedAccessSignatureAuthorizationRule.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_keys_for_key_name_with_http_info(resource_group_name, resource_name, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a shared access policy by name from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get a shared access policy by name from an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • key_name (String)

    The name of the shared access policy.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1712
1713
1714
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1712

def get_keys_for_key_name_with_http_info(resource_group_name, resource_name, key_name, custom_headers:nil)
  get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers:custom_headers).value!
end

#get_quota_metrics(resource_group_name, resource_name, custom_headers: nil) ⇒ Array<IotHubQuotaMetricInfo>

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Array<IotHubQuotaMetricInfo>)

    operation results.



1370
1371
1372
1373
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1370

def get_quota_metrics(resource_group_name, resource_name, custom_headers:nil)
  first_page = get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers: nil) ⇒ IotHubQuotaMetricInfoListResult

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

contains the IoT hub. will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (IotHubQuotaMetricInfoListResult)

    which provide lazy access to pages



3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3257

def get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers:nil)
  response = get_quota_metrics_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#get_quota_metrics_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1405

def get_quota_metrics_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics'

  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,'resourceName' => resource_name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::IotHubQuotaMetricInfoListResult.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_quota_metrics_next(next_page_link, custom_headers: nil) ⇒ IotHubQuotaMetricInfoListResult

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (IotHubQuotaMetricInfoListResult)

    operation results.



2930
2931
2932
2933
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2930

def get_quota_metrics_next(next_page_link, custom_headers:nil)
  response = get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_quota_metrics_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2963

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

  options = {
      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, 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::IotHub::Mgmt::V2018_01_22::Models::IotHubQuotaMetricInfoListResult.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_quota_metrics_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2947
2948
2949
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2947

def get_quota_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_quota_metrics_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the quota metrics for an IoT hub.

Get the quota metrics for an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1388
1389
1390
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1388

def get_quota_metrics_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  get_quota_metrics_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#get_stats(resource_group_name, resource_name, custom_headers: nil) ⇒ RegistryStatistics

Get the statistics from an IoT hub.

Get the statistics from an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (RegistryStatistics)

    operation results.



489
490
491
492
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 489

def get_stats(resource_group_name, resource_name, custom_headers:nil)
  response = get_stats_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_stats_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Get the statistics from an IoT hub.

Get the statistics from an IoT hub.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
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
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 524

def get_stats_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats'

  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,'resourceName' => resource_name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::RegistryStatistics.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_stats_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the statistics from an IoT hub.

Get the statistics from an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



507
508
509
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 507

def get_stats_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  get_stats_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#get_valid_skus(resource_group_name, resource_name, custom_headers: nil) ⇒ Array<IotHubSkuDescription>

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Array<IotHubSkuDescription>)

    operation results.



592
593
594
595
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 592

def get_valid_skus(resource_group_name, resource_name, custom_headers:nil)
  first_page = get_valid_skus_as_lazy(resource_group_name, resource_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_valid_skus_as_lazy(resource_group_name, resource_name, custom_headers: nil) ⇒ IotHubSkuDescriptionListResult

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

contains the IoT hub. will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (IotHubSkuDescriptionListResult)

    which provide lazy access to pages



3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3176

def get_valid_skus_as_lazy(resource_group_name, resource_name, custom_headers:nil)
  response = get_valid_skus_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      get_valid_skus_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#get_valid_skus_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



627
628
629
630
631
632
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
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 627

def get_valid_skus_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus'

  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,'resourceName' => resource_name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::IotHubSkuDescriptionListResult.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_valid_skus_next(next_page_link, custom_headers: nil) ⇒ IotHubSkuDescriptionListResult

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (IotHubSkuDescriptionListResult)

    operation results.



2630
2631
2632
2633
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2630

def get_valid_skus_next(next_page_link, custom_headers:nil)
  response = get_valid_skus_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_valid_skus_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2663

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

  options = {
      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, 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::IotHub::Mgmt::V2018_01_22::Models::IotHubSkuDescriptionListResult.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_valid_skus_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2647
2648
2649
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2647

def get_valid_skus_next_with_http_info(next_page_link, custom_headers:nil)
  get_valid_skus_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_valid_skus_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the list of valid SKUs for an IoT hub.

Get the list of valid SKUs for an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



610
611
612
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 610

def get_valid_skus_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  get_valid_skus_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the non-security related metadata of an IoT hub.

Get the non-security related metadata of an IoT hub.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



55
56
57
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 55

def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#import_devices(resource_group_name, resource_name, import_devices_parameters, custom_headers: nil) ⇒ JobResponse

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

contains the IoT hub. specify the import devices operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • import_devices_parameters (ImportDevicesRequest)

    The parameters that

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

    A hash of custom headers that

Returns:

  • (JobResponse)

    operation results.



1936
1937
1938
1939
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1936

def import_devices(resource_group_name, resource_name, import_devices_parameters, custom_headers:nil)
  response = import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

contains the IoT hub. specify the import devices operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • import_devices_parameters (ImportDevicesRequest)

    The parameters that

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1983

def import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'import_devices_parameters is nil' if import_devices_parameters.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::IotHub::Mgmt::V2018_01_22::Models::ImportDevicesRequest.mapper()
  request_content = @client.serialize(request_mapper,  import_devices_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices'

  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,'resourceName' => resource_name},
      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::IotHub::Mgmt::V2018_01_22::Models::JobResponse.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

#import_devices_with_http_info(resource_group_name, resource_name, import_devices_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.

contains the IoT hub. specify the import devices operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • import_devices_parameters (ImportDevicesRequest)

    The parameters that

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1960
1961
1962
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1960

def import_devices_with_http_info(resource_group_name, resource_name, import_devices_parameters, custom_headers:nil)
  import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers:custom_headers).value!
end

#list_by_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<IotHubDescription>

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

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

    A hash of custom headers that

Returns:

  • (Array<IotHubDescription>)

    operation results.



389
390
391
392
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 389

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ IotHubDescriptionListResult

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

contains the IoT hub. will be added to the HTTP request.

the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

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

    A hash of custom headers that

Returns:

  • (IotHubDescriptionListResult)

    which provide lazy access to pages of



3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3151

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 422

def list_by_resource_group_async(resource_group_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs'

  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},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::IotHubDescriptionListResult.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

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ IotHubDescriptionListResult

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (IotHubDescriptionListResult)

    operation results.



2534
2535
2536
2537
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2534

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2567

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

  options = {
      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, 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::IotHub::Mgmt::V2018_01_22::Models::IotHubDescriptionListResult.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

#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2551
2552
2553
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2551

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the IoT hubs in a resource group.

Get all the IoT hubs in a resource group.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



406
407
408
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 406

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_by_subscription(custom_headers: nil) ⇒ Array<IotHubDescription>

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<IotHubDescription>)

    operation results.



295
296
297
298
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 295

def list_by_subscription(custom_headers:nil)
  first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_subscription_as_lazy(custom_headers: nil) ⇒ IotHubDescriptionListResult

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

will be added to the HTTP request.

the response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (IotHubDescriptionListResult)

    which provide lazy access to pages of



3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3127

def list_by_subscription_as_lazy(custom_headers:nil)
  response = list_by_subscription_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_subscription_async(custom_headers: nil) ⇒ Concurrent::Promise

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

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.



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
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 324

def list_by_subscription_async(custom_headers: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}/providers/Microsoft.Devices/IotHubs'

  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},
      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 = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescriptionListResult.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

#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ IotHubDescriptionListResult

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (IotHubDescriptionListResult)

    operation results.



2438
2439
2440
2441
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2438

def list_by_subscription_next(next_page_link, custom_headers:nil)
  response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2471

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

  options = {
      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, 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::IotHub::Mgmt::V2018_01_22::Models::IotHubDescriptionListResult.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

#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2455
2456
2457
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2455

def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get all the IoT hubs in a subscription.

Get all the IoT hubs in a subscription.

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.



310
311
312
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 310

def list_by_subscription_with_http_info(custom_headers:nil)
  list_by_subscription_async(custom_headers:custom_headers).value!
end

#list_event_hub_consumer_groups(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers: nil) ⇒ Array<EventHubConsumerGroupInfo>

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

contains the IoT hub. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

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

    A hash of custom headers that

Returns:

  • (Array<EventHubConsumerGroupInfo>)

    operation results.



699
700
701
702
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 699

def list_event_hub_consumer_groups(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers:nil)
  first_page = list_event_hub_consumer_groups_as_lazy(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_event_hub_consumer_groups_as_lazy(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers: nil) ⇒ EventHubConsumerGroupsListResult

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

contains the IoT hub. endpoint. will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

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

    A hash of custom headers that

Returns:

  • (EventHubConsumerGroupsListResult)

    which provide lazy access to pages



3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3205

def list_event_hub_consumer_groups_as_lazy(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers:nil)
  response = list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_event_hub_consumer_groups_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

contains the IoT hub. endpoint. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 742

def list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if resource_name.nil?
  fail ArgumentError, 'event_hub_endpoint_name is nil' if event_hub_endpoint_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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups'

  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,'resourceName' => resource_name,'eventHubEndpointName' => event_hub_endpoint_name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::EventHubConsumerGroupsListResult.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

#list_event_hub_consumer_groups_next(next_page_link, custom_headers: nil) ⇒ EventHubConsumerGroupsListResult

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (EventHubConsumerGroupsListResult)

    operation results.



2728
2729
2730
2731
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2728

def list_event_hub_consumer_groups_next(next_page_link, custom_headers:nil)
  response = list_event_hub_consumer_groups_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_event_hub_consumer_groups_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2765

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

  options = {
      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, 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::IotHub::Mgmt::V2018_01_22::Models::EventHubConsumerGroupsListResult.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

#list_event_hub_consumer_groups_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2747
2748
2749
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2747

def list_event_hub_consumer_groups_next_with_http_info(next_page_link, custom_headers:nil)
  list_event_hub_consumer_groups_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_event_hub_consumer_groups_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub.

contains the IoT hub. endpoint. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • event_hub_endpoint_name (String)

    The name of the Event Hub-compatible

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



721
722
723
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 721

def list_event_hub_consumer_groups_with_http_info(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers:nil)
  list_event_hub_consumer_groups_async(resource_group_name, resource_name, event_hub_endpoint_name, custom_headers:custom_headers).value!
end

#list_jobs(resource_group_name, resource_name, custom_headers: nil) ⇒ Array<JobResponse>

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Array<JobResponse>)

    operation results.



1150
1151
1152
1153
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1150

def list_jobs(resource_group_name, resource_name, custom_headers:nil)
  first_page = list_jobs_as_lazy(resource_group_name, resource_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_jobs_as_lazy(resource_group_name, resource_name, custom_headers: nil) ⇒ JobResponseListResult

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (JobResponseListResult)

    which provide lazy access to pages of the



3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3232

def list_jobs_as_lazy(resource_group_name, resource_name, custom_headers:nil)
  response = list_jobs_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_jobs_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_jobs_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1189

def list_jobs_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs'

  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,'resourceName' => resource_name},
      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
      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::IotHub::Mgmt::V2018_01_22::Models::JobResponseListResult.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

#list_jobs_next(next_page_link, custom_headers: nil) ⇒ JobResponseListResult

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (JobResponseListResult)

    operation results.



2830
2831
2832
2833
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2830

def list_jobs_next(next_page_link, custom_headers:nil)
  response = list_jobs_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_jobs_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2867

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

  options = {
      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, 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::IotHub::Mgmt::V2018_01_22::Models::JobResponseListResult.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

#list_jobs_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2849
2850
2851
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2849

def list_jobs_next_with_http_info(next_page_link, custom_headers:nil)
  list_jobs_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_jobs_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

Get a list of all the jobs in an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1170
1171
1172
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1170

def list_jobs_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  list_jobs_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#list_keys(resource_group_name, resource_name, custom_headers: nil) ⇒ Array<SharedAccessSignatureAuthorizationRule>

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (Array<SharedAccessSignatureAuthorizationRule>)

    operation results.



1581
1582
1583
1584
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1581

def list_keys(resource_group_name, resource_name, custom_headers:nil)
  first_page = list_keys_as_lazy(resource_group_name, resource_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_keys_as_lazy(resource_group_name, resource_name, custom_headers: nil) ⇒ SharedAccessSignatureAuthorizationRuleListResult

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. will be added to the HTTP request.

access to pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (SharedAccessSignatureAuthorizationRuleListResult)

    which provide lazy



3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3284

def list_keys_as_lazy(resource_group_name, resource_name, custom_headers:nil)
  response = list_keys_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_keys_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_keys_async(resource_group_name, resource_name, custom_headers: nil) ⇒ Concurrent::Promise

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1620

def list_keys_async(resource_group_name, resource_name, custom_headers: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?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'resource_name is nil' if 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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys'

  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,'resourceName' => resource_name},
      query_params: {'api-version' => @client.api_version},
      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::IotHub::Mgmt::V2018_01_22::Models::SharedAccessSignatureAuthorizationRuleListResult.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

#list_keys_next(next_page_link, custom_headers: nil) ⇒ SharedAccessSignatureAuthorizationRuleListResult

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (SharedAccessSignatureAuthorizationRuleListResult)

    operation results.



3028
3029
3030
3031
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3028

def list_keys_next(next_page_link, custom_headers:nil)
  response = list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_keys_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3065

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

  options = {
      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(: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::IotHub::Mgmt::V2018_01_22::Models::SharedAccessSignatureAuthorizationRuleListResult.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

#list_keys_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3047
3048
3049
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3047

def list_keys_next_with_http_info(next_page_link, custom_headers:nil)
  list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_keys_with_http_info(resource_group_name, resource_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

Get the security metadata for an IoT hub. For more information, see: docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.

contains the IoT hub. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group that

  • resource_name (String)

    The name of the IoT hub.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1601
1602
1603
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1601

def list_keys_with_http_info(resource_group_name, resource_name, custom_headers:nil)
  list_keys_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
end

#update(resource_group_name, resource_name, iot_hub_tags, custom_headers: nil) ⇒ IotHubDescription

Update an existing IoT Hubs tags.

Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method

iot hub instance. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Resource group identifier.

  • resource_name (String)

    Name of iot hub to update.

  • iot_hub_tags (TagsResource)

    Updated tag information to set into the

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



198
199
200
201
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 198

def update(resource_group_name, resource_name, iot_hub_tags, custom_headers:nil)
  response = update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers: nil) ⇒ Concurrent::Promise

iot hub instance. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Resource group identifier.

  • resource_name (String)

    Name of iot hub to update.

  • iot_hub_tags (TagsResource)

    Updated tag information to set into the

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/2018-01-22/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 214

def update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, resource_name, iot_hub_tags, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::IotHub::Mgmt::V2018_01_22::Models::IotHubDescription.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