Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DigitalTwins

Package version

Class representing a DigitalTwins.

Hierarchy

  • DigitalTwins

Index

Constructors

constructor

Methods

add

  • Adds or replaces a digital twin. Status codes:

    • 200 OK
    • 400 Bad Request
      • InvalidArgument - The digital twin id or payload is invalid.
      • ModelDecommissioned - The model for the digital twin is decommissioned.
      • TwinLimitReached - The maximum number of digital twins allowed has been reached.
      • ValidationFailed - The digital twin payload is not valid.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • twin: any

      The digital twin instance being added. If provided, the $dtId property is ignored.

    • Optional options: DigitalTwinsAddOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsAddResponse>

addRelationship

  • Adds a relationship between two digital twins. Status codes:

    • 200 OK
    • 400 Bad Request
      • InvalidArgument - The digital twin id, relationship id, or payload is invalid.
      • InvalidRelationship - The relationship is invalid.
      • OperationNotAllowed - The relationship cannot connect to the same digital twin.
      • ValidationFailed - The relationship content is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
      • TargetTwinNotFound - The digital twin target of the relationship was not found.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • relationshipId: string

      The id of the relationship. The id is unique within the digital twin and case sensitive.

    • relationship: any

      The data for the relationship.

    • Optional options: DigitalTwinsAddRelationshipOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsAddRelationshipResponse>

delete

  • Deletes a digital twin. All relationships referencing the digital twin must already be deleted. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id is invalid.
      • RelationshipsNotDeleted - The digital twin contains relationships.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • Optional options: DigitalTwinsDeleteOptionalParams

      The options parameters.

    Returns Promise<coreHttp.RestResponse>

deleteRelationship

  • Deletes a relationship between two digital twins. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id or relationship id is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
      • RelationshipNotFound - The relationship was not found.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • relationshipId: string

      The id of the relationship. The id is unique within the digital twin and case sensitive.

    • Optional options: DigitalTwinsDeleteRelationshipOptionalParams

      The options parameters.

    Returns Promise<coreHttp.RestResponse>

getById

getComponent

  • Retrieves a component from a digital twin. Status codes:

    • 200 OK
    • 400 Bad Request
      • InvalidArgument - The digital twin id or component path is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
      • ComponentNotFound - The component path was not found.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • componentPath: string

      The name of the DTDL component.

    • Optional options: DigitalTwinsGetComponentOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsGetComponentResponse>

getRelationshipById

  • Retrieves a relationship between two digital twins. Status codes:

    • 200 OK
    • 400 Bad Request
      • InvalidArgument - The digital twin id or relationship id is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
      • RelationshipNotFound - The relationship was not found.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • relationshipId: string

      The id of the relationship. The id is unique within the digital twin and case sensitive.

    • Optional options: DigitalTwinsGetRelationshipByIdOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsGetRelationshipByIdResponse>

listIncomingRelationships

listIncomingRelationshipsNext

listRelationships

listRelationshipsNext

sendComponentTelemetry

  • Sends telemetry on behalf of a component in a digital twin. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id, message id, or component path is invalid.
      • ValidationFailed - The telemetry content is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
      • ComponentNotFound - The component path was not found.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • componentPath: string

      The name of the DTDL component.

    • messageId: string

      A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.

    • telemetry: any

      The telemetry measurements to send from the digital twin's component.

    • Optional options: DigitalTwinsSendComponentTelemetryOptionalParams

      The options parameters.

    Returns Promise<coreHttp.RestResponse>

sendTelemetry

  • Sends telemetry on behalf of a digital twin. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id or message id is invalid.
      • ValidationFailed - The telemetry content is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • messageId: string

      A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.

    • telemetry: any

      The telemetry measurements to send from the digital twin.

    • Optional options: DigitalTwinsSendTelemetryOptionalParams

      The options parameters.

    Returns Promise<coreHttp.RestResponse>

update

  • Updates a digital twin. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id or payload is invalid.
      • JsonPatchInvalid - The JSON Patch provided is invalid.
      • ValidationFailed - Applying the patch results in an invalid digital twin.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • patchDocument: any[]

      An update specification described by JSON Patch. Updates to property values and $model elements may happen in the same request. Operations are limited to add, replace and remove.

    • Optional options: DigitalTwinsUpdateOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsUpdateResponse>

updateComponent

  • Updates a component on a digital twin. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id, component path, or payload is invalid.
      • JsonPatchInvalid - The JSON Patch provided is invalid.
      • ValidationFailed - Applying the patch results in an invalid digital twin.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • componentPath: string

      The name of the DTDL component.

    • patchDocument: any[]

      An update specification described by JSON Patch. Updates to property values and $model elements may happen in the same request. Operations are limited to add, replace and remove.

    • Optional options: DigitalTwinsUpdateComponentOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsUpdateComponentResponse>

updateRelationship

  • Updates the properties on a relationship between two digital twins. Status codes:

    • 204 No Content
    • 400 Bad Request
      • InvalidArgument - The digital twin id or relationship id is invalid.
      • InvalidRelationship - The relationship is invalid.
      • JsonPatchInvalid - The JSON Patch provided is invalid.
      • ValidationFailed - The relationship content is invalid.
    • 404 Not Found
      • DigitalTwinNotFound - The digital twin was not found.
      • RelationshipNotFound - The relationship was not found.
    • 409 Conflict
      • RelationshipAlreadyExists - The relationship already exists.
    • 412 Precondition Failed
      • PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.

    Parameters

    • id: string

      The id of the digital twin. The id is unique within the service and case sensitive.

    • relationshipId: string

      The id of the relationship. The id is unique within the digital twin and case sensitive.

    • patchDocument: any[]

      JSON Patch description of the update to the relationship properties.

    • Optional options: DigitalTwinsUpdateRelationshipOptionalParams

      The options parameters.

    Returns Promise<DigitalTwinsUpdateRelationshipResponse>

Generated using TypeDoc