Class: Azure::IotHub::Mgmt::V2016_02_03::IotHubResource

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2016-02-03/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/2016-02-03/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/2016-02-03/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, 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. 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 to create or update.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



2010
2011
2012
2013
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2010

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

#begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, 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. 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 to create or update.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2053

def begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, 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['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::IotHub::Mgmt::V2016_02_03::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::V2016_02_03::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::V2016_02_03::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, 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. 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 to create or update.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2032
2033
2034
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2032

def begin_create_or_update_with_http_info(resource_group_name, resource_name, iot_hub_description, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, resource_name, iot_hub_description, 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 to delete.

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



2139
2140
2141
2142
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2139

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 to delete.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2174

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::V2016_02_03::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::V2016_02_03::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::V2016_02_03::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 to delete.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2157
2158
2159
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2157

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

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



1419
1420
1421
1422
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1419

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.



1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1452

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::V2016_02_03::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::V2016_02_03::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.



1436
1437
1438
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1436

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.



881
882
883
884
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 881

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.



922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 922

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::V2016_02_03::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.



902
903
904
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 902

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, 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. 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 to create or update.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

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

    A hash of custom headers that

Returns:

  • (IotHubDescription)

    operation results.



144
145
146
147
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 144

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

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

contains the IoT hub. security metadata. 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 to create or update.

  • iot_hub_description (IotHubDescription)

    The IoT hub metadata and

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 161

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

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

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



192
193
194
195
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 192

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 to delete.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 207

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



994
995
996
997
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 994

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.



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1035

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.



1015
1016
1017
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1015

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.



1754
1755
1756
1757
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1754

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.



1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1801

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::V2016_02_03::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::V2016_02_03::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.



1778
1779
1780
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1778

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/2016-02-03/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/2016-02-03/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::V2016_02_03::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.



763
764
765
766
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 763

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.



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 808

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::V2016_02_03::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.



786
787
788
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 786

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.



1207
1208
1209
1210
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1207

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.



1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1248

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::V2016_02_03::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.



1228
1229
1230
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1228

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.



1638
1639
1640
1641
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1638

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.



1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1679

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::V2016_02_03::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.



1659
1660
1661
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1659

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.



1317
1318
1319
1320
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1317

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



3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3080

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.



1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1352

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::V2016_02_03::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.



2753
2754
2755
2756
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2753

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.



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
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2786

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::V2016_02_03::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.



2770
2771
2772
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2770

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.



1335
1336
1337
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1335

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.



436
437
438
439
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 436

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.



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 471

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::V2016_02_03::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.



454
455
456
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 454

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.



539
540
541
542
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 539

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



2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2999

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.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 574

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::V2016_02_03::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.



2453
2454
2455
2456
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2453

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.



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
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2486

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::V2016_02_03::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.



2470
2471
2472
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2470

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.



557
558
559
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 557

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/2016-02-03/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.



1883
1884
1885
1886
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1883

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.



1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1930

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::V2016_02_03::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::V2016_02_03::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.



1907
1908
1909
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1907

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



336
337
338
339
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 336

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



2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2974

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



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 369

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::V2016_02_03::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.



2357
2358
2359
2360
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2357

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.



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
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2390

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::V2016_02_03::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.



2374
2375
2376
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2374

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



353
354
355
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 353

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.



242
243
244
245
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 242

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



2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2950

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.



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 271

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::V2016_02_03::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.



2261
2262
2263
2264
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2261

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.



2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2294

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::V2016_02_03::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.



2278
2279
2280
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2278

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.



257
258
259
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 257

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

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

    operation results.



646
647
648
649
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 646

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



3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3028

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.



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 689

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::V2016_02_03::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.



2551
2552
2553
2554
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2551

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.



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
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2588

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::V2016_02_03::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.



2570
2571
2572
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2570

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.



668
669
670
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 668

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.



1097
1098
1099
1100
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1097

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



3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3055

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.



1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1136

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::V2016_02_03::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.



2653
2654
2655
2656
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2653

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.



2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2690

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::V2016_02_03::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.



2672
2673
2674
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2672

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.



1117
1118
1119
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1117

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.



1528
1529
1530
1531
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1528

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



3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 3107

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.



1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1567

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::V2016_02_03::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.



2851
2852
2853
2854
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2851

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.



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
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2888

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::V2016_02_03::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.



2870
2871
2872
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 2870

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.



1548
1549
1550
# File 'lib/2016-02-03/generated/azure_mgmt_iot_hub/iot_hub_resource.rb', line 1548

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