共用方式為


DigitalTwinsClient.DeleteModel(String, CancellationToken) Method

Definition

Deletes a model synchronously.

public virtual Azure.Response DeleteModel (string modelId, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteModel : string * System.Threading.CancellationToken -> Azure.Response
override this.DeleteModel : string * System.Threading.CancellationToken -> Azure.Response
Public Overridable Function DeleteModel (modelId As String, Optional cancellationToken As CancellationToken = Nothing) As Response

Parameters

modelId
String

The id for the model. The id is globally unique and case sensitive.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

The HTTP response Response.

Exceptions

The exception that captures the errors from the service. Check the ErrorCode and Status properties for more details.

The exception is thrown when modelId is null.

Remarks

A model can only be deleted if no other models reference it. Status codes: 204 (No Content): Success. 400 (Bad Request): The request is invalid. 404 (Not Found): There is no model with the provided id. 409 (Conflict): There are dependencies on the model that prevent it from being deleted.

For more samples, see our repo samples.

Applies to

See also