Skip to main content

iot_hub_resource

Creates, updates, deletes, gets or lists an iot_hub_resource resource.

Overview

Nameiot_hub_resource
TypeResource
Idazure.iot_hub.iot_hub_resource

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
etagstringThe etag.
propertiesobjectThe tags.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_event_hub_consumer_groupselectresource_group_name, resource_name, event_hub_endpoint_name, name, subscription_idGet 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.
list_event_hub_consumer_groupsselectresource_group_name, resource_name, event_hub_endpoint_name, subscription_idGet 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.
get_jobselectresource_group_name, resource_name, job_id, subscription_idGet the details of a job from an IoT hub. For more information, see: https://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: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry .
get_keys_for_key_nameselectresource_group_name, resource_name, key_name, subscription_idGet a shared access policy by name from an IoT hub. For more information, see: https://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: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security .
getselectresource_group_name, resource_name, subscription_idGet the non-security related metadata of an IoT hub. Get the non-security related metadata of an IoT hub.
get_endpoint_healthselectresource_group_name, iot_hub_name, subscription_idGet the health for routing endpoints. Get the health for routing endpoints.
list_by_resource_groupselectresource_group_name, subscription_idGet all the IoT hubs in a resource group. Get all the IoT hubs in a resource group.
check_name_availabilityselectsubscription_idCheck if an IoT hub name is available. Check if an IoT hub name is available.
list_by_subscriptionselectsubscription_idGet all the IoT hubs in a subscription. Get all the IoT hubs in a subscription.
create_or_updateinsertresource_group_name, resource_name, subscription_id, location, skuCreate 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.
updateupdateresource_group_name, resource_name, subscription_idUpdate an existing IoT Hubs tags. Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method.
create_or_updatereplaceresource_group_name, resource_name, subscription_id, location, skuCreate 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.
deletedeleteresource_group_name, resource_name, subscription_idDelete an IoT hub. Delete an IoT hub.
list_jobsexecresource_group_name, resource_name, subscription_idGet a list of all the jobs in an IoT hub. For more information, see: https://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: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry .
list_keysexecresource_group_name, resource_name, subscription_idGet the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security . Get the security metadata for an IoT hub. For more information, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security .
get_valid_skusexecresource_group_name, resource_name, subscription_idGet the list of valid SKUs for an IoT hub. Get the list of valid SKUs for an IoT hub.
get_quota_metricsexecresource_group_name, resource_name, subscription_idGet the quota metrics for an IoT hub. Get the quota metrics for an IoT hub.
get_statsexecresource_group_name, resource_name, subscription_idGet the statistics from an IoT hub. Get the statistics from an IoT hub.
create_event_hub_consumer_groupexecresource_group_name, resource_name, event_hub_endpoint_name, name, subscription_id, propertiesAdd 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.
delete_event_hub_consumer_groupexecresource_group_name, resource_name, event_hub_endpoint_name, name, subscription_idDelete 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.
test_all_routesexeciot_hub_name, resource_group_name, subscription_idTest all routes. Test all routes configured in this Iot Hub.
test_routeexeciot_hub_name, resource_group_name, subscription_id, routeTest the new route. Test the new route for this Iot Hub.
export_devicesexecresource_group_name, resource_name, subscription_id, exportBlobContainerUri, excludeKeysExports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more information, see: https://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: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities .
import_devicesexecresource_group_name, resource_name, subscription_id, inputBlobContainerUri, outputBlobContainerUriImport, update, or delete device identities in the IoT hub identity registry from a blob. For more information, see: https://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: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities .

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
event_hub_endpoint_namestringThe name of the EventHubEndpoint. Required.
iot_hub_namestringRequired.
job_idstringThe job identifier. Required.
key_namestringThe name of the shared access policy. Required.
namestringThe name of the consumer group to retrieve. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
resource_namestringThe name of the IoT hub. Required.
subscription_idstring

SELECT examples

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.

SELECT
id,
name,
etag,
properties,
systemData,
type
FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND resource_name = '{{ resource_name }}' -- required
AND event_hub_endpoint_name = '{{ event_hub_endpoint_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

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.

INSERT INTO azure.iot_hub.iot_hub_resource (
tags,
location,
properties,
etag,
sku,
identity,
resource_group_name,
resource_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ etag }}',
'{{ sku }}' /* required */,
'{{ identity }}',
'{{ resource_group_name }}',
'{{ resource_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

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

UPDATE azure.iot_hub.iot_hub_resource
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type;

REPLACE examples

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.

REPLACE azure.iot_hub.iot_hub_resource
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
etag = '{{ etag }}',
sku = '{{ sku }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
AND sku = '{{ sku }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Delete an IoT hub. Delete an IoT hub.

DELETE FROM azure.iot_hub.iot_hub_resource
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND resource_name = '{{ resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Get a list of all the jobs in an IoT hub. For more information, see: https://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: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry .

EXEC azure.iot_hub.iot_hub_resource.list_jobs 
@resource_group_name='{{ resource_group_name }}' --required,
@resource_name='{{ resource_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;