Skip to content

start_device_discovery

start_device_discovery(
    discovery_type: DiscoveryType,
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    custom_protocol_detail: Optional[CustomProtocolDetail] = None,
    controller_identifier: Optional[ManagedThingId] = None,
    connector_association_identifier: Optional[ConnectorAssociationId] = None,
    account_association_id: Optional[AccountAssociationId] = None,
    authentication_material: Optional[DiscoveryAuthMaterialString] = None,
    authentication_material_type: Optional[DiscoveryAuthMaterialType] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
    connector_device_id_list: Optional[ConnectorDeviceIdList] = None,
    protocol: Optional[ProtocolType] = None,
    end_device_identifier: Optional[ManagedThingId] = None,
) -> StartDeviceDiscoveryResponse

This API is used to start device discovery for hub-connected and third-party-connected devices. The authentication material (install code) is delivered as a message to the controller instructing it to start the discovery.

Parameters:

  • discovery_type (DiscoveryType) –

    The discovery type supporting the type of device to be discovered in the device discovery task request.

  • custom_protocol_detail (Optional[CustomProtocolDetail], default: None ) –

    Additional protocol-specific details required for device discovery, which vary based on the discovery type.

    For a DiscoveryType of CUSTOM, the string-to-string map must have a key value of Name set to a non-empty-string.

  • controller_identifier (Optional[ManagedThingId], default: None ) –

    The id of the end-user's IoT hub.

  • connector_association_identifier (Optional[ConnectorAssociationId], default: None ) –

    The id of the connector association.

  • account_association_id (Optional[AccountAssociationId], default: None ) –

    The identifier of the cloud-to-cloud account association to use for discovery of third-party devices.

  • authentication_material (Optional[DiscoveryAuthMaterialString], default: None ) –

    The authentication material required to start the local device discovery job request.

  • authentication_material_type (Optional[DiscoveryAuthMaterialType], default: None ) –

    The type of authentication material used for device discovery jobs.

  • client_token (Optional[ClientToken], default: None ) –

    An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

  • tags (Optional[TagsMap], default: None ) –

    A set of key/value pairs that are used to manage the device discovery request.

  • connector_device_id_list (Optional[ConnectorDeviceIdList], default: None ) –

    Used as a filter for PLA discoveries.

  • protocol (Optional[ProtocolType], default: None ) –

    The protocol type for capability rediscovery (ZWAVE, ZIGBEE, or CUSTOM).

    This parameter is only available when the discovery type is CONTROLLER_CAPABILITY_REDISCOVERY.

  • end_device_identifier (Optional[ManagedThingId], default: None ) –

    The unique id of the end device for capability rediscovery.

    This parameter is only available when the discovery type is CONTROLLER_CAPABILITY_REDISCOVERY.

Raises:

Source code in docs_src/capo_iot_managed_integrations/_services/io_t_managed_integrations.py
def start_device_discovery(
    self,
    discovery_type: "capo_iot_managed_integrations.types.discovery_type.DiscoveryType",
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    custom_protocol_detail: Optional[
        "capo_iot_managed_integrations.types.custom_protocol_detail.CustomProtocolDetail"
    ] = None,
    controller_identifier: Optional[
        "capo_iot_managed_integrations.types.managed_thing_id.ManagedThingId"
    ] = None,
    connector_association_identifier: Optional[
        "capo_iot_managed_integrations.types.connector_association_id.ConnectorAssociationId"
    ] = None,
    account_association_id: Optional[
        "capo_iot_managed_integrations.types.account_association_id.AccountAssociationId"
    ] = None,
    authentication_material: Optional[
        "capo_iot_managed_integrations.types.discovery_auth_material_string.DiscoveryAuthMaterialString"
    ] = None,
    authentication_material_type: Optional[
        "capo_iot_managed_integrations.types.discovery_auth_material_type.DiscoveryAuthMaterialType"
    ] = None,
    client_token: Optional[
        "capo_iot_managed_integrations.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_iot_managed_integrations.types.tags_map.TagsMap"] = None,
    connector_device_id_list: Optional[
        "capo_iot_managed_integrations.types.connector_device_id_list.ConnectorDeviceIdList"
    ] = None,
    protocol: Optional[
        "capo_iot_managed_integrations.types.protocol_type.ProtocolType"
    ] = None,
    end_device_identifier: Optional[
        "capo_iot_managed_integrations.types.managed_thing_id.ManagedThingId"
    ] = None,
) -> "capo_iot_managed_integrations.types.start_device_discovery_response.StartDeviceDiscoveryResponse":
    """<p> This API is used to start device discovery for hub-connected and third-party-connected devices. The authentication material (install code) is delivered as a message to the controller instructing it to start the discovery.</p>

    Args:
        discovery_type: <p>The discovery type supporting the type of device to be discovered in the device discovery task request.</p>
        custom_protocol_detail: <p>Additional protocol-specific details required for device discovery, which vary based on the discovery type.</p> <note> <p>For a <code>DiscoveryType</code> of <code>CUSTOM</code>, the string-to-string map must have a key value of <code>Name</code> set to a non-empty-string.</p> </note>
        controller_identifier: <p>The id of the end-user's IoT hub.</p>
        connector_association_identifier: <p>The id of the connector association.</p>
        account_association_id: <p>The identifier of the cloud-to-cloud account association to use for discovery of third-party devices.</p>
        authentication_material: <p>The authentication material required to start the local device discovery job request.</p>
        authentication_material_type: <p>The type of authentication material used for device discovery jobs.</p>
        client_token: <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
        tags: <p>A set of key/value pairs that are used to manage the device discovery request.</p>
        connector_device_id_list: <p>Used as a filter for PLA discoveries.</p>
        protocol: <p>The protocol type for capability rediscovery (ZWAVE, ZIGBEE, or CUSTOM).</p> <note> <p>This parameter is only available when the discovery type is CONTROLLER_CAPABILITY_REDISCOVERY.</p> </note>
        end_device_identifier: <p>The unique id of the end device for capability rediscovery.</p> <note> <p>This parameter is only available when the discovery type is CONTROLLER_CAPABILITY_REDISCOVERY.</p> </note>

    Raises:
        capo_iot_managed_integrations.errors.access_denied_exception.AccessDeniedException: <p>User is not authorized.</p>
        capo_iot_managed_integrations.errors.conflict_exception.ConflictException: <p>There is a conflict with the request.</p>
        capo_iot_managed_integrations.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot_managed_integrations.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot_managed_integrations.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot_managed_integrations.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot_managed_integrations.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot_managed_integrations.errors.validation_exception.ValidationException: <p>A validation error occurred when performing the API request.</p>
        capo_iot_managed_integrations.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot_managed_integrations.types.start_device_discovery_request.StartDeviceDiscoveryRequest]",
    ) -> OperationResponse[
        "capo_iot_managed_integrations.types.start_device_discovery_response.StartDeviceDiscoveryResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.start_device_discovery

        output, http_response = (
            capo_iot_managed_integrations._operations.iot_managed_integrations.start_device_discovery.start_device_discovery(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iot_managed_integrations.types.start_device_discovery_request.StartDeviceDiscoveryRequest",
    ) -> dict[str, Any]:
        import capo_iot_managed_integrations.types.start_device_discovery_request

        return capo_iot_managed_integrations.types.start_device_discovery_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartDeviceDiscovery", redact_input=_redact_input),
    )
    input_: capo_iot_managed_integrations.types.start_device_discovery_request.StartDeviceDiscoveryRequest = {
        "discovery_type": discovery_type
    }
    if custom_protocol_detail is not None:
        input_["custom_protocol_detail"] = custom_protocol_detail
    if controller_identifier is not None:
        input_["controller_identifier"] = controller_identifier
    if connector_association_identifier is not None:
        input_["connector_association_identifier"] = (
            connector_association_identifier
        )
    if account_association_id is not None:
        input_["account_association_id"] = account_association_id
    if authentication_material is not None:
        input_["authentication_material"] = authentication_material
    if authentication_material_type is not None:
        input_["authentication_material_type"] = authentication_material_type
    if client_token is not None:
        input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags
    if connector_device_id_list is not None:
        input_["connector_device_id_list"] = connector_device_id_list
    if protocol is not None:
        input_["protocol"] = protocol
    if end_device_identifier is not None:
        input_["end_device_identifier"] = end_device_identifier

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output