IoTSiteWise / Client / delete_asset_model

delete_asset_model#

IoTSiteWise.Client.delete_asset_model(**kwargs)#

Deletes an asset model. This action can’t be undone. You must delete all assets created from an asset model before you can delete the model. Also, you can’t delete an asset model if a parent asset model exists that contains a property formula expression that depends on the asset model that you want to delete. For more information, see Deleting assets and models in the IoT SiteWise User Guide.

See also: AWS API Documentation

Request Syntax

response = client.delete_asset_model(
    assetModelId='string',
    clientToken='string',
    ifMatch='string',
    ifNoneMatch='string',
    matchForVersionType='LATEST'|'ACTIVE'
)
Parameters:
  • assetModelId (string) –

    [REQUIRED]

    The ID of the asset model to delete. This can be either the actual ID in UUID format, or else externalId: followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the IoT SiteWise User Guide.

  • clientToken (string) –

    A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don’t reuse this client token if a new idempotent request is required.

    This field is autopopulated if not provided.

  • ifMatch (string) – The expected current entity tag (ETag) for the asset model’s latest or active version (specified using matchForVersionType). The delete request is rejected if the tag does not match the latest or active version’s current entity tag. See Optimistic locking for asset model writes in the IoT SiteWise User Guide.

  • ifNoneMatch (string) – Accepts * to reject the delete request if an active version (specified using matchForVersionType as ACTIVE) already exists for the asset model.

  • matchForVersionType (string) – Specifies the asset model version type ( LATEST or ACTIVE) used in conjunction with If-Match or If-None-Match headers to determine the target ETag for the delete operation.

Return type:

dict

Returns:

Response Syntax

{
    'assetModelStatus': {
        'state': 'CREATING'|'ACTIVE'|'UPDATING'|'PROPAGATING'|'DELETING'|'FAILED',
        'error': {
            'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE',
            'message': 'string',
            'details': [
                {
                    'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION',
                    'message': 'string'
                },
            ]
        }
    }
}

Response Structure

  • (dict) –

    • assetModelStatus (dict) –

      The status of the asset model, which contains a state ( DELETING after successfully calling this operation) and any error message.

      • state (string) –

        The current state of the asset model.

      • error (dict) –

        Contains associated error information, if any.

        • code (string) –

          The error code.

        • message (string) –

          The error message.

        • details (list) –

          A list of detailed errors.

          • (dict) –

            Contains detailed error information.

            • code (string) –

              The error code.

            • message (string) –

              The error message.

Exceptions

  • IoTSiteWise.Client.exceptions.InvalidRequestException

  • IoTSiteWise.Client.exceptions.ResourceNotFoundException

  • IoTSiteWise.Client.exceptions.InternalFailureException

  • IoTSiteWise.Client.exceptions.ThrottlingException

  • IoTSiteWise.Client.exceptions.ConflictingOperationException

  • IoTSiteWise.Client.exceptions.PreconditionFailedException