From 9135e2063fba5479098437a9261e1f2b281fb624 Mon Sep 17 00:00:00 2001 From: Sebastian Herzig-Patel Date: Wed, 29 Jun 2022 02:49:55 -0700 Subject: [PATCH] Microsoft.DigitalTwins - add stable data-plane API version 2022-05-31 (#18790) * Add blockchain to latest profile * Add additional types * Adds base for updating Microsoft.DigitalTwins from version preview/2021-06-30-preview to version 2022-05-31 * Updates readme * Updates API version in new specs and examples * Add new API version * Update build configuration * Add sourceTime examples * Reformat examples * Address review comments * Address more review feedback * Fix required fields * Address semantic validation errors * Fix lintdiff errors * Fix lintdiff warnings * Address model validation errors * Fix formatting * Add back readonly, since model is only returned by service * Remove required properties from Error model Co-authored-by: Mark Cowlishaw --- .../stable/2022-05-31/digitaltwins.json | 1632 +++++++++++++++++ .../CreateRelationshipAdvancedExample.json | 26 + .../CreateRelationshipBasicExample.json | 22 + .../2022-05-31/examples/DeleteModel.json | 9 + .../examples/DeleteRelationship.json | 10 + .../2022-05-31/examples/DeleteTwin.json | 9 + .../2022-05-31/examples/EventRouteDelete.json | 9 + .../2022-05-31/examples/EventRouteGet.json | 15 + .../2022-05-31/examples/EventRoutePut.json | 13 + .../examples/EventRoutePutWithFilter.json | 13 + .../2022-05-31/examples/EventRoutesList.json | 24 + .../2022-05-31/examples/GetComponent.json | 36 + .../examples/GetIncomingRelationship.json | 27 + .../2022-05-31/examples/GetRelationship.json | 31 + .../examples/GetRelationshipById.json | 19 + .../GetRelationshipByRelationshipName.json | 32 + .../stable/2022-05-31/examples/GetTwin.json | 38 + .../stable/2022-05-31/examples/ModelAdd.json | 47 + .../2022-05-31/examples/ModelGetById.json | 15 + ...odelGetByIdWithIncludeModelDefinition.json | 41 + .../examples/ModelUpdateDecommissioned.json | 16 + .../stable/2022-05-31/examples/ModelsGet.json | 35 + ...DependenciesAndIncludeModelDefinition.json | 70 + .../PatchComponentAdvancedExample.json | 31 + .../examples/PatchComponentBasicExample.json | 17 + .../PatchRelationshipAdvancedExample.json | 26 + .../PatchRelationshipBasicExample.json | 17 + .../examples/PatchTwinAdvancedExample.json | 30 + .../examples/PatchTwinBasicExample.json | 16 + .../examples/PutTwinAdvancedExample.json | 62 + .../examples/PutTwinBasicExample.json | 22 + .../2022-05-31/examples/QueryFirstPage.json | 75 + .../stable/2022-05-31/examples/QueryJoin.json | 96 + .../2022-05-31/examples/QueryNextPage.json | 73 + .../2022-05-31/examples/SendTelemetry.json | 14 + .../examples/SendTelemetryFromComponent.json | 15 + .../digitaltwins/data-plane/readme.go.md | 10 + .../digitaltwins/data-plane/readme.md | 27 +- .../digitaltwins/data-plane/readme.python.md | 11 + 39 files changed, 2722 insertions(+), 9 deletions(-) create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/digitaltwins.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipAdvancedExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipBasicExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteModel.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteRelationship.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteTwin.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteDelete.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteGet.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePut.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePutWithFilter.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutesList.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetComponent.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetIncomingRelationship.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationship.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipById.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipByRelationshipName.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetTwin.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelAdd.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetById.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetByIdWithIncludeModelDefinition.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelUpdateDecommissioned.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGet.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentAdvancedExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentBasicExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipAdvancedExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipBasicExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinAdvancedExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinBasicExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinAdvancedExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinBasicExample.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryFirstPage.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryJoin.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryNextPage.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetry.json create mode 100644 specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetryFromComponent.json diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/digitaltwins.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/digitaltwins.json new file mode 100644 index 000000000000..e0f207e2343b --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/digitaltwins.json @@ -0,0 +1,1632 @@ +{ + "swagger": "2.0", + "info": { + "version": "2022-05-31", + "title": "Azure Digital Twins API", + "description": "A service for managing and querying digital twins and digital twin models." + }, + "host": "digitaltwins-hostname", + "schemes": [ + "https" + ], + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "paths": { + "/models": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "post": { + "tags": [ + "Models" + ], + "description": "Uploads one or more models. When any error occurs, no models are uploaded.\nStatus codes:\n* 201 Created\n* 400 Bad Request\n * DTDLParserError - The models provided are not valid DTDL.\n * InvalidArgument - The model id is invalid.\n * LimitExceeded - The maximum number of model ids allowed in 'dependenciesFor' has been reached.\n * ModelVersionNotSupported - The version of DTDL used is not supported.\n* 409 Conflict\n * ModelAlreadyExists - The model provided already exists.", + "operationId": "DigitalTwinModels_Add", + "x-ms-examples": { + "Add models": { + "$ref": "./examples/ModelAdd.json" + } + }, + "parameters": [ + { + "name": "models", + "in": "body", + "description": "An array of models to add.", + "required": true, + "schema": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "201": { + "description": "Success", + "schema": { + "$ref": "#/definitions/NonPagedDigitalTwinsModelDataCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "Models" + ], + "description": "Retrieves model metadata and, optionally, model definitions.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The model id is invalid.\n * LimitExceeded - The maximum number of model ids allowed in 'dependenciesFor' has been reached.\n* 404 Not Found\n * ModelNotFound - The model was not found.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "operationId": "DigitalTwinModels_List", + "x-ms-examples": { + "List models": { + "$ref": "./examples/ModelsGet.json" + }, + "List models (include dependencies and definitions)": { + "$ref": "./examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json" + } + }, + "parameters": [ + { + "name": "dependenciesFor", + "in": "query", + "description": "The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + } + }, + { + "$ref": "#/parameters/includeModelDefinition" + }, + { + "$ref": "#/parameters/max-items-per-page" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/PagedDigitalTwinsModelDataCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/models/{id}": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "Models" + ], + "description": "Retrieves model metadata and optionally the model definition.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The model id is invalid.\n * MissingArgument - The model id was not provided.\n* 404 Not Found\n * ModelNotFound - The model was not found.", + "operationId": "DigitalTwinModels_GetById", + "x-ms-examples": { + "Get a model by id": { + "$ref": "./examples/ModelGetById.json" + }, + "Get a model by id (with definition)": { + "$ref": "./examples/ModelGetByIdWithIncludeModelDefinition.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/modelId" + }, + { + "$ref": "#/parameters/includeModelDefinition" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/DigitalTwinsModelData" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Models" + ], + "description": "Updates the metadata for a model.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The model id is invalid.\n * JsonPatchInvalid - The JSON Patch provided is invalid.\n * MissingArgument - The model id was not provided.\n* 404 Not Found\n * ModelNotFound - The model was not found.\n* 409 Conflict\n * ModelReferencesNotDecommissioned - The model refers to models that are not decommissioned.", + "operationId": "DigitalTwinModels_Update", + "consumes": [ + "application/json-patch+json" + ], + "x-ms-examples": { + "Decommission a model": { + "$ref": "./examples/ModelUpdateDecommissioned.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/modelId" + }, + { + "name": "updateModel", + "description": "An update specification described by JSON Patch. Only the decommissioned property can be replaced.", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Models" + ], + "operationId": "DigitalTwinModels_Delete", + "description": "Deletes a model. A model can only be deleted if no other models reference it.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The model id is invalid.\n * MissingArgument - The model id was not provided.\n* 404 Not Found\n * ModelNotFound - The model was not found.\n* 409 Conflict\n * ModelReferencesNotDeleted - The model refers to models that are not deleted.", + "x-ms-examples": { + "Delete a model": { + "$ref": "./examples/DeleteModel.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/modelId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/query": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "post": { + "tags": [ + "Query" + ], + "operationId": "Query_QueryTwins", + "description": "Executes a query that allows traversing relationships and filtering by property values.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * BadRequest - The continuation token is invalid.\n * SqlQueryError - The query contains some errors.\n * TimeoutError - The query execution timed out after 60 seconds. Try simplifying the query or adding conditions to reduce the result size.\n * 429 Too Many Requests\n * QuotaReachedError - The maximum query rate limit has been reached.", + "x-ms-examples": { + "Query for digital twins": { + "$ref": "./examples/QueryFirstPage.json" + }, + "Retrieve paged query results": { + "$ref": "./examples/QueryNextPage.json" + }, + "Query for digital twins through a relationship": { + "$ref": "./examples/QueryJoin.json" + } + }, + "parameters": [ + { + "name": "querySpecification", + "in": "body", + "description": "The query specification to execute.", + "required": true, + "schema": { + "$ref": "#/definitions/QuerySpecification" + } + }, + { + "$ref": "#/parameters/max-items-per-page" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/QueryResult" + }, + "headers": { + "query-charge": { + "description": "The query charge.", + "type": "number" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_GetById", + "description": "Retrieves a digital twin.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.", + "x-ms-examples": { + "Get a digital twin by id": { + "$ref": "./examples/GetTwin.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_Add", + "description": "Adds or replaces a digital twin.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id or payload is invalid.\n * ModelDecommissioned - The model for the digital twin is decommissioned.\n * TwinLimitReached - The maximum number of digital twins allowed has been reached.\n * ValidationFailed - The digital twin payload is not valid.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "x-ms-examples": { + "Add a digital twin": { + "$ref": "./examples/PutTwinBasicExample.json" + }, + "Add a digital twin (with properties and components)": { + "$ref": "./examples/PutTwinAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "twin", + "description": "The digital twin instance being added. If provided, the $dtId property is ignored.", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + }, + { + "$ref": "#/parameters/if-none-match-star" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_Delete", + "description": "Deletes a digital twin. All relationships referencing the digital twin must already be deleted.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id is invalid.\n * RelationshipsNotDeleted - The digital twin contains relationships.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "x-ms-examples": { + "Delete a digital twin": { + "$ref": "./examples/DeleteTwin.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_Update", + "description": "Updates a digital twin.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id or payload is invalid.\n * JsonPatchInvalid - The JSON Patch provided is invalid.\n * ValidationFailed - Applying the patch results in an invalid digital twin.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "consumes": [ + "application/json-patch+json" + ], + "x-ms-examples": { + "Update a digital twin": { + "$ref": "./examples/PatchTwinBasicExample.json" + }, + "Update a digital twin (multiple updates)": { + "$ref": "./examples/PatchTwinAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "patchDocument", + "description": "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.", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/relationships/{relationshipId}": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_GetRelationshipById", + "description": "Retrieves a relationship between two digital twins.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id or relationship id is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n * RelationshipNotFound - The relationship was not found.", + "x-ms-examples": { + "Get a relationship by id": { + "$ref": "./examples/GetRelationshipById.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_AddRelationship", + "description": "Adds a relationship between two digital twins.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id, relationship id, or payload is invalid.\n * InvalidRelationship - The relationship is invalid.\n * OperationNotAllowed - The relationship cannot connect to the same digital twin.\n * ValidationFailed - The relationship content is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n * TargetTwinNotFound - The digital twin target of the relationship was not found.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "x-ms-examples": { + "Create a relationship": { + "$ref": "./examples/CreateRelationshipBasicExample.json" + }, + "Create a relationship (with properties)": { + "$ref": "./examples/CreateRelationshipAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "name": "relationship", + "in": "body", + "description": "The data for the relationship.", + "required": true, + "schema": { + "type": "object" + } + }, + { + "$ref": "#/parameters/if-none-match-star" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_DeleteRelationship", + "description": "Deletes a relationship between two digital twins.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id or relationship id is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n * RelationshipNotFound - The relationship was not found.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "x-ms-examples": { + "Delete a relationship": { + "$ref": "./examples/DeleteRelationship.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Twins" + ], + "consumes": [ + "application/json-patch+json" + ], + "operationId": "DigitalTwins_UpdateRelationship", + "description": "Updates the properties on a relationship between two digital twins.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id or relationship id is invalid.\n * InvalidRelationship - The relationship is invalid.\n * JsonPatchInvalid - The JSON Patch provided is invalid.\n * ValidationFailed - The relationship content is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n * RelationshipNotFound - The relationship was not found.\n* 409 Conflict\n * RelationshipAlreadyExists - The relationship already exists.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "x-ms-examples": { + "Update relationship properties": { + "$ref": "./examples/PatchRelationshipBasicExample.json" + }, + "Update relationship properties (multiple updates)": { + "$ref": "./examples/PatchRelationshipAdvancedExample.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/relationshipId" + }, + { + "name": "patchDocument", + "description": "JSON Patch description of the update to the relationship properties.", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/relationships": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_ListRelationships", + "description": "Retrieves the relationships from a digital twin.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List relationships": { + "$ref": "./examples/GetRelationship.json" + }, + "List relationships by name": { + "$ref": "./examples/GetRelationshipByRelationshipName.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "relationshipName", + "description": "The name of the relationship.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RelationshipCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/incomingrelationships": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_ListIncomingRelationships", + "description": "Retrieves all incoming relationship for a digital twin.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List incoming relationships": { + "$ref": "./examples/GetIncomingRelationship.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/IncomingRelationshipCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/telemetry": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "post": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_SendTelemetry", + "description": "Sends telemetry on behalf of a digital twin.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id or message id is invalid.\n * ValidationFailed - The telemetry content is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.", + "x-ms-examples": { + "Send telemetry": { + "$ref": "./examples/SendTelemetry.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "name": "telemetry", + "in": "body", + "description": "The telemetry measurements to send from the digital twin.", + "required": true, + "schema": { + "type": "object" + } + }, + { + "name": "Message-Id", + "in": "header", + "description": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.", + "required": true, + "type": "string" + }, + { + "name": "Telemetry-Source-Time", + "in": "header", + "description": "An RFC 3339 timestamp that identifies the time the telemetry was measured.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/components/{componentPath}/telemetry": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "post": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_SendComponentTelemetry", + "description": "Sends telemetry on behalf of a component in a digital twin.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id, message id, or component path is invalid.\n * ValidationFailed - The telemetry content is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n * ComponentNotFound - The component path was not found.", + "x-ms-examples": { + "Send telemetry in a component": { + "$ref": "./examples/SendTelemetryFromComponent.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/componentPath" + }, + { + "name": "telemetry", + "in": "body", + "description": "The telemetry measurements to send from the digital twin's component.", + "required": true, + "schema": { + "type": "object" + } + }, + { + "name": "Message-Id", + "in": "header", + "description": "A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages.", + "required": true, + "type": "string" + }, + { + "name": "Telemetry-Source-Time", + "in": "header", + "description": "An RFC 3339 timestamp that identifies the time the telemetry was measured.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/digitaltwins/{id}/components/{componentPath}": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_GetComponent", + "description": "Retrieves a component from a digital twin.\nStatus codes:\n* 200 OK\n* 400 Bad Request\n * InvalidArgument - The digital twin id or component path is invalid.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n * ComponentNotFound - The component path was not found.", + "x-ms-examples": { + "Get a component in a digital twin": { + "$ref": "./examples/GetComponent.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/componentPath" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "type": "object" + }, + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Twins" + ], + "operationId": "DigitalTwins_UpdateComponent", + "description": "Updates a component on a digital twin.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * InvalidArgument - The digital twin id, component path, or payload is invalid.\n * JsonPatchInvalid - The JSON Patch provided is invalid.\n * ValidationFailed - Applying the patch results in an invalid digital twin.\n* 404 Not Found\n * DigitalTwinNotFound - The digital twin was not found.\n* 412 Precondition Failed\n * PreconditionFailed - The precondition check (If-Match or If-None-Match) failed.", + "x-ms-examples": { + "Update a component in a digital twin": { + "$ref": "./examples/PatchComponentBasicExample.json" + }, + "Update a component in a digital twin (multiple updates)": { + "$ref": "./examples/PatchComponentAdvancedExample.json" + } + }, + "consumes": [ + "application/json-patch+json" + ], + "parameters": [ + { + "$ref": "#/parameters/digitalTwinId" + }, + { + "$ref": "#/parameters/componentPath" + }, + { + "name": "patchDocument", + "description": "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.", + "in": "body", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "object" + } + } + }, + { + "$ref": "#/parameters/if-match" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "description": "Weak Etag.", + "type": "string" + } + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/eventroutes": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "EventRoutes" + ], + "description": "Retrieves all event routes.\nStatus codes:\n* 200 OK", + "operationId": "EventRoutes_List", + "x-ms-examples": { + "List event routes": { + "$ref": "./examples/EventRoutesList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/max-items-per-page" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/EventRouteCollection" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/eventroutes/{id}": { + "parameters": [ + { + "$ref": "#/parameters/traceparent" + }, + { + "$ref": "#/parameters/tracestate" + } + ], + "get": { + "tags": [ + "EventRoutes" + ], + "description": "Retrieves an event route.\nStatus codes:\n* 200 OK\n* 404 Not Found\n * EventRouteNotFound - The event route was not found.", + "operationId": "EventRoutes_GetById", + "x-ms-examples": { + "Get an event route by id": { + "$ref": "./examples/EventRouteGet.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/eventRouteId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/EventRoute" + } + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "EventRoutes" + ], + "description": "Adds or replaces an event route.\nStatus codes:\n* 204 No Content\n* 400 Bad Request\n * EventRouteEndpointInvalid - The endpoint provided does not exist or is not active.\n * EventRouteFilterInvalid - The event route filter is invalid.\n * EventRouteIdInvalid - The event route id is invalid.\n * LimitExceeded - The maximum number of event routes allowed has been reached.", + "operationId": "EventRoutes_Add", + "x-ms-examples": { + "Add an event route": { + "$ref": "./examples/EventRoutePut.json" + }, + "Add an event route (with filter)": { + "$ref": "./examples/EventRoutePutWithFilter.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/eventRouteId" + }, + { + "name": "eventRoute", + "description": "The event route data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EventRoute" + } + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "EventRoutes" + ], + "description": "Deletes an event route.\nStatus codes:\n* 204 No Content\n* 404 Not Found\n * EventRouteNotFound - The event route was not found.", + "operationId": "EventRoutes_Delete", + "x-ms-examples": { + "Delete an event route": { + "$ref": "./examples/EventRouteDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/eventRouteId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "204": { + "description": "Success" + }, + "default": { + "description": "Default response.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "EventRoute": { + "description": "A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub.", + "type": "object", + "required": [ + "endpointName", + "filter" + ], + "properties": { + "id": { + "description": "The id of the event route.", + "type": "string", + "readOnly": true + }, + "endpointName": { + "description": "The name of the endpoint this event route is bound to.", + "type": "string" + }, + "filter": { + "description": "An expression which describes the events which are routed to the endpoint.", + "type": "string" + } + } + }, + "EventRouteCollection": { + "description": "A collection of EventRoute objects.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "description": "The EventRoute objects.", + "type": "array", + "items": { + "$ref": "#/definitions/EventRoute" + } + }, + "nextLink": { + "description": "A URI to retrieve the next page of results.", + "type": "string" + } + } + }, + "NonPagedDigitalTwinsModelDataCollection": { + "description": "A collection of DigitalTwinsModelData objects.", + "type": "array", + "items": { + "$ref": "#/definitions/DigitalTwinsModelData" + } + }, + "PagedDigitalTwinsModelDataCollection": { + "description": "A collection of DigitalTwinsModelData objects.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "description": "The DigitalTwinsModelData objects.", + "type": "array", + "items": { + "$ref": "#/definitions/DigitalTwinsModelData" + } + }, + "nextLink": { + "description": "A URI to retrieve the next page of objects.", + "type": "string" + } + } + }, + "DigitalTwinsModelData": { + "description": "A model definition and metadata for that model.", + "required": [ + "id" + ], + "type": "object", + "properties": { + "displayName": { + "description": "A language map that contains the localized display names as specified in the model definition.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "description": "A language map that contains the localized descriptions as specified in the model definition.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "id": { + "description": "The id of the model as specified in the model definition.", + "type": "string" + }, + "uploadTime": { + "description": "The time the model was uploaded to the service.", + "format": "date-time", + "type": "string" + }, + "decommissioned": { + "description": "Indicates if the model is decommissioned. Decommissioned models cannot be referenced by newly created digital twins.", + "type": "boolean", + "default": false + }, + "model": { + "description": "The model definition.", + "type": "object" + } + } + }, + "RelationshipCollection": { + "description": "A collection of relationships which relate digital twins together.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "description": "The relationship objects.", + "type": "array", + "items": { + "description": "The relationship JSON document.", + "type": "object" + } + }, + "nextLink": { + "description": "A URI to retrieve the next page of objects.", + "type": "string" + } + } + }, + "IncomingRelationshipCollection": { + "description": "A collection of incoming relationships which relate digital twins together.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/IncomingRelationship" + } + }, + "nextLink": { + "type": "string", + "description": "A URI to retrieve the next page of objects." + } + } + }, + "IncomingRelationship": { + "type": "object", + "description": "An incoming relationship.", + "properties": { + "$relationshipId": { + "type": "string", + "description": "A user-provided string representing the id of this relationship, unique in the context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service." + }, + "$sourceId": { + "type": "string", + "description": "The id of the source digital twin." + }, + "$relationshipName": { + "type": "string", + "description": "The name of the relationship." + }, + "$relationshipLink": { + "type": "string", + "description": "Link to the relationship, to be used for deletion." + } + } + }, + "QuerySpecification": { + "description": "A query specification containing either a query statement or a continuation token from a previous query result.", + "type": "object", + "properties": { + "query": { + "description": "The query to execute. This value is ignored if a continuation token is provided.", + "type": "string" + }, + "continuationToken": { + "description": "A token which is used to retrieve the next set of results from a previous query.", + "type": "string" + } + } + }, + "QueryResult": { + "description": "The results of a query operation and an optional continuation token.", + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "description": "The query results.", + "type": "array", + "items": { + "type": "object" + } + }, + "continuationToken": { + "description": "A token which can be used to construct a new QuerySpecification to retrieve the next set of results.", + "type": "string" + } + } + }, + "ErrorResponse": { + "description": "Error response.", + "required": [ + "error" + ], + "properties": { + "error": { + "$ref": "#/definitions/Error", + "description": "The error details." + } + } + }, + "Error": { + "description": "Error definition.", + "properties": { + "code": { + "description": "Service specific error code which serves as the substatus for the HTTP error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "A human-readable representation of the error.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "Internal error details.", + "type": "array", + "items": { + "$ref": "#/definitions/Error" + }, + "readOnly": true + }, + "innererror": { + "description": "An object containing more specific information than the current object about the error.", + "$ref": "#/definitions/InnerError" + } + } + }, + "InnerError": { + "description": "A more specific error description than was provided by the containing error.", + "properties": { + "code": { + "description": "A more specific error code than was provided by the containing error.", + "type": "string" + }, + "innererror": { + "description": "An object containing more specific information than the current object about the error.", + "$ref": "#/definitions/InnerError" + } + } + } + }, + "securityDefinitions": { + "oauth2": { + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize?resource=0b07f429-9f4b-4714-9392-cc5e8e80c8b0", + "type": "oauth2" + } + }, + "parameters": { + "eventRouteId": { + "name": "id", + "in": "path", + "required": true, + "type": "string", + "description": "The id for an event route. The id is unique within event routes and case sensitive.", + "x-ms-parameter-location": "method" + }, + "includeModelDefinition": { + "name": "includeModelDefinition", + "description": "When true the model definition will be returned as part of the result.", + "in": "query", + "required": false, + "type": "boolean", + "default": false, + "x-ms-parameter-location": "method" + }, + "digitalTwinId": { + "name": "id", + "in": "path", + "description": "The id of the digital twin. The id is unique within the service and case sensitive.", + "type": "string", + "required": true, + "x-ms-parameter-location": "method" + }, + "modelId": { + "name": "id", + "in": "path", + "description": "The id for the model. The id is globally unique and case sensitive.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "relationshipId": { + "name": "relationshipId", + "description": "The id of the relationship. The id is unique within the digital twin and case sensitive.", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "componentPath": { + "name": "componentPath", + "in": "path", + "description": "The name of the DTDL component.", + "type": "string", + "required": true, + "x-ms-parameter-location": "method" + }, + "api-version": { + "name": "api-version", + "in": "query", + "description": "The requested API version.", + "required": true, + "type": "string", + "minLength": 1 + }, + "max-items-per-page": { + "name": "max-items-per-page", + "in": "header", + "description": "The maximum number of items to retrieve per request. The server may choose to return less than the requested number.", + "required": false, + "type": "integer", + "x-ms-client-name": "MaxItemsPerPage", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + } + }, + "if-none-match-star": { + "name": "If-None-Match", + "in": "header", + "description": "Only perform the operation if the entity does not already exist.", + "required": false, + "type": "string", + "enum": [ + "*" + ], + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + } + }, + "if-match": { + "name": "If-Match", + "in": "header", + "description": "Only perform the operation if the entity's etag matches one of the etags provided or * is provided.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + } + }, + "traceparent": { + "name": "traceparent", + "in": "header", + "description": "Identifies the request in a distributed tracing system.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + } + }, + "tracestate": { + "name": "tracestate", + "in": "header", + "description": "Provides vendor-specific trace identification information and is a companion to traceparent.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "postfix": "Options" + } + } + }, + "security": [ + { + "oauth2": [] + } + ] +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipAdvancedExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipAdvancedExample.json new file mode 100644 index 000000000000..80fdf6aaa886 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipAdvancedExample.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId", + "relationship": { + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty1": 1, + "relationshipProperty2": "some value" + } + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "relationshipProperty1": 1, + "relationshipProperty2": "some value", + "$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipBasicExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipBasicExample.json new file mode 100644 index 000000000000..90fc1062b2a2 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/CreateRelationshipBasicExample.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId", + "relationship": { + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship" + } + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteModel.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteModel.json new file mode 100644 index 000000000000..50fc3b098b5e --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteModel.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "dtmi:com:example:Sample;1" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteRelationship.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteRelationship.json new file mode 100644 index 000000000000..61b6c91c4ad9 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteRelationship.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "relationshipId": "myRelationshipId" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteTwin.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteTwin.json new file mode 100644 index 000000000000..574eda46ed45 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/DeleteTwin.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteDelete.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteDelete.json new file mode 100644 index 000000000000..0bbf9a9e4b61 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteDelete.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "id": "eventroute-001", + "api-version": "2022-05-31" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteGet.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteGet.json new file mode 100644 index 000000000000..1f910535a18b --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRouteGet.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "id": "eventroute-001", + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "id": "eventroute-001", + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePut.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePut.json new file mode 100644 index 000000000000..8bb4ec715f87 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePut.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "id": "eventroute-001", + "eventRoute": { + "endpointName": "endpoint-001", + "filter": "true" + }, + "api-version": "2022-05-31" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePutWithFilter.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePutWithFilter.json new file mode 100644 index 000000000000..d41a88523107 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutePutWithFilter.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "id": "eventroute-001", + "eventRoute": { + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + }, + "api-version": "2022-05-31" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutesList.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutesList.json new file mode 100644 index 000000000000..06cfe887ef68 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/EventRoutesList.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "eventroute-001", + "endpointName": "endpoint-001", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create'" + }, + { + "id": "eventroute-002", + "endpointName": "endpoint-002", + "filter": "type = 'Microsoft.DigitalTwins.Twin.Create' OR type = 'microsoft.iot.telemetry'" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetComponent.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetComponent.json new file mode 100644 index 000000000000..57c253e73a24 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetComponent.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "componentPath": "myComponent" + }, + "responses": { + "200": { + "body": { + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "componentProperty": "some value", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "componentProperty": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + } + }, + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "property1": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "property2": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + } + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetIncomingRelationship.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetIncomingRelationship.json new file mode 100644 index 000000000000..e44377e60731 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetIncomingRelationship.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "mySourceTwin" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$relationshipName": "myRelationship", + "$relationshipLink": "/digitaltwins/mySourceTwin/relationships/myRelationship/firstRelationshipId" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$relationshipName": "myRelationship", + "$relationshipLink": "/digitaltwins/mySourceTwin/relationships/myRelationship/secondRelationshipId" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationship.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationship.json new file mode 100644 index 000000000000..e4d652167100 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationship.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "mySourceTwin" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"", + "property": "value" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "$etag": "W/\"2552a0a7-0666-4d5e-a67f-ece5b9b81fe0\"", + "property": "value" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipById.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipById.json new file mode 100644 index 000000000000..a30435cb0ebb --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipById.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "mySourceTwin", + "relationshipId": "myRelationshipId" + }, + "responses": { + "200": { + "body": { + "$relationshipId": "myRelationshipId", + "$sourceId": "mySourceTwin", + "$targetId": "myTargetTwin", + "$relationshipName": "myRelationship", + "$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"", + "relationshipProperty": "some value" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipByRelationshipName.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipByRelationshipName.json new file mode 100644 index 000000000000..69b03769e370 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetRelationshipByRelationshipName.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "mySourceTwin", + "relationshipName": "myRelationship" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$sourceId": "mySourceTwin", + "$relationshipId": "firstRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"", + "property": "value" + }, + { + "$sourceId": "mySourceTwin", + "$relationshipId": "secondRelationshipId", + "$targetId": "targetTwinId", + "$relationshipName": "myRelationship", + "$etag": "W/\"2552a0a7-0666-4d5e-a67f-ece5b9b81fe0\"", + "property": "value" + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetTwin.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetTwin.json new file mode 100644 index 000000000000..721f446d2935 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/GetTwin.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId" + }, + "responses": { + "200": { + "body": { + "$dtId": "myTwinId", + "$etag": "W/\"9c2876c2-aff0-40b3-9fba-0c6be9d020a6\"", + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "componentProperty": "some value", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "componentProperty": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + } + }, + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "property1": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "property2": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + } + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelAdd.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelAdd.json new file mode 100644 index 000000000000..3f066c1a012a --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelAdd.json @@ -0,0 +1,47 @@ +{ + "parameters": { + "models": [ + { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "displayName": "Sample Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + ], + "api-version": "2022-05-31" + }, + "responses": { + "201": { + "body": [ + { + "id": "dtmi:com:example:Sample;1", + "displayName": { + "en": "Sample Interface" + }, + "uploadTime": "2022-02-28T00:30:00.1234567Z", + "decommissioned": false + } + ] + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetById.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetById.json new file mode 100644 index 000000000000..022d26051296 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetById.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "id": "dtmi:com:example:Sample;1", + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2022-02-28T00:30:00.1234567Z", + "decommissioned": false + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetByIdWithIncludeModelDefinition.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetByIdWithIncludeModelDefinition.json new file mode 100644 index 000000000000..3b3a5a687d68 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelGetByIdWithIncludeModelDefinition.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "id": "dtmi:com:example:Sample;1", + "includeModelDefinition": true, + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2022-02-28T00:30:00.1234567Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelUpdateDecommissioned.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelUpdateDecommissioned.json new file mode 100644 index 000000000000..a841ac388634 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelUpdateDecommissioned.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "id": "dtmi:com:example:Sample;1", + "updateModel": [ + { + "op": "replace", + "path": "/decommissioned", + "value": true + } + ], + "api-version": "2022-05-31" + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGet.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGet.json new file mode 100644 index 000000000000..05856911c033 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGet.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2022-02-28T00:30:00.1234567Z", + "decommissioned": false + }, + { + "id": "dtmi:com:example:SampleDeviceModel;1", + "displayName": { + "en": "My Device Model" + }, + "uploadTime": "2022-02-27T00:30:00.1234567Z", + "decommissioned": false + }, + { + "id": "dtmi:com:example:AnotherSample;1", + "displayName": { + "en": "My Sample" + }, + "uploadTime": "2022-02-26T00:30:00.1234567Z", + "decommissioned": false + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json new file mode 100644 index 000000000000..62ae803eb22b --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/ModelsGetWithDependenciesAndIncludeModelDefinition.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "includeModelDefinition": true, + "dependenciesFor": [ + "dtmi:com:example:SampleDeviceModel;1" + ], + "x-ms-max-item-count": 20, + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "dtmi:com:example:Sample;1", + "uploadTime": "2022-02-28T00:30:00.1234567Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:Sample;1", + "@type": "Interface", + "contents": [ + { + "@type": "Property", + "name": "name", + "displayName": "Sample instance name", + "schema": "string" + }, + { + "@type": "Property", + "name": "temp", + "displayName": "Sample instance temperature", + "schema": "integer" + }, + { + "@type": "Property", + "name": "comfortIndex", + "displayName": "Sample instance comfort index", + "schema": "integer" + } + ], + "@context": "dtmi:dtdl:context;2" + } + }, + { + "id": "dtmi:com:example:SampleDeviceModel;1", + "displayName": { + "en": "My Device Model" + }, + "uploadTime": "2022-02-28T00:30:00.1234567Z", + "decommissioned": false, + "model": { + "@id": "dtmi:com:example:SampleDeviceModel;1", + "@type": "Interface", + "displayName": "My Device Model", + "contents": [ + { + "@type": "Component", + "name": "Sample", + "schema": "dtmi:com:example:Sample;1" + } + ], + "@context": "dtmi:dtdl:context;2" + } + } + ], + "nextLink": "url-to-next-page" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentAdvancedExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentAdvancedExample.json new file mode 100644 index 000000000000..1cd4abe19206 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentAdvancedExample.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "componentPath": "myComponent", + "patchDocument": [ + { + "op": "add", + "path": "/property1", + "value": 1 + }, + { + "op": "replace", + "path": "/$metadata/property1/sourceTime", + "value": "2022-05-31T12:00:01.000125009Z" + }, + { + "op": "remove", + "path": "/property2" + }, + { + "op": "replace", + "path": "/property3/subProperty1", + "value": "new value" + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentBasicExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentBasicExample.json new file mode 100644 index 000000000000..ce21e83010a0 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchComponentBasicExample.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "componentPath": "myComponent", + "patchDocument": [ + { + "op": "add", + "path": "/property", + "value": 1 + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipAdvancedExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipAdvancedExample.json new file mode 100644 index 000000000000..c7b3965dcc99 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipAdvancedExample.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "relationshipId": "myRelationshipId", + "patchDocument": [ + { + "op": "add", + "path": "/property1", + "value": 1 + }, + { + "op": "remove", + "path": "/property2" + }, + { + "op": "replace", + "path": "/property3/subProperty1", + "value": "new value" + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipBasicExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipBasicExample.json new file mode 100644 index 000000000000..f4732d490d5e --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchRelationshipBasicExample.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "relationshipId": "myRelationshipId", + "patchDocument": [ + { + "op": "add", + "path": "/property", + "value": 1 + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinAdvancedExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinAdvancedExample.json new file mode 100644 index 000000000000..13de80ce0ed8 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinAdvancedExample.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myNewTwinId", + "patchDocument": [ + { + "op": "replace", + "path": "/property1", + "value": 1 + }, + { + "op": "replace", + "path": "/$metadata/property1/sourceTime", + "value": "2022-05-31T12:00:01.000125009Z" + }, + { + "op": "add", + "path": "/property2/subProperty1", + "value": 1 + }, + { + "op": "remove", + "path": "/property3" + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinBasicExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinBasicExample.json new file mode 100644 index 000000000000..02045c1a0b7e --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PatchTwinBasicExample.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myNewTwinId", + "patchDocument": [ + { + "op": "replace", + "path": "/property1", + "value": 1 + } + ] + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinAdvancedExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinAdvancedExample.json new file mode 100644 index 000000000000..76be89812ecc --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinAdvancedExample.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myNewTwinId", + "If-None-Match": "*", + "twin": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "sourceTime": "2022-05-31T12:00:01.000125009Z" + } + }, + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "$metadata": { + "componentProperty": { + "sourceTime": "2022-05-31T12:00:00.000125009Z" + } + }, + "componentProperty": "some value" + } + } + }, + "responses": { + "200": { + "body": { + "$dtId": "myNewTwinId", + "$etag": "W/\"9c2876c2-aff0-40b3-9fba-0c6be9d020a6\"", + "property1": 1, + "property2": { + "subProperty1": "some value", + "subProperty2": "some other value" + }, + "component1": { + "componentProperty": "some value", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "componentProperty": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "sourceTime": "2022-05-31T12:00:01.000125009Z" + } + } + }, + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "property1": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "sourceTime": "2022-05-31T12:00:01.000125009Z" + }, + "property2": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + } + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinBasicExample.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinBasicExample.json new file mode 100644 index 000000000000..fc415c27e000 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/PutTwinBasicExample.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myNewTwinId", + "twin": { + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1" + } + } + }, + "responses": { + "200": { + "body": { + "$dtId": "myNewTwinId", + "$metadata": { + "$model": "dtmi:com:example:interfaces:interfaceName;1", + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryFirstPage.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryFirstPage.json new file mode 100644 index 000000000000..8326068ed8c5 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryFirstPage.json @@ -0,0 +1,75 @@ +{ + "parameters": { + "querySpecification": { + "query": "SELECT * FROM DIGITALTWINS WHERE temp = 79" + }, + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$dtId": "Twin-01", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample01", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-02", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:29:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:29:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:29:00.1234567Z", + "sourceTime": "2022-05-31T12:00:00.000125009Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:29:00.1234567Z" + } + }, + "name": "Sample02", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-03", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:31:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:31:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:31:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:31:00.1234567Z" + } + }, + "name": "Sample03", + "temp": 79, + "comfortIndex": 50 + } + ], + "continuationToken": "" + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryJoin.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryJoin.json new file mode 100644 index 000000000000..5a64bac1d499 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryJoin.json @@ -0,0 +1,96 @@ +{ + "parameters": { + "querySpecification": { + "query": "SELECT Widget, Gadget FROM DIGITALTWINS Widget JOIN Gadget RELATED Widget.Contains WHERE Widget.$dtId = 'Twin-01'" + }, + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "Widget": { + "$dtId": "Twin-01", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample01", + "temp": 79, + "comfortIndex": 50 + }, + "Gadget": { + "$dtId": "Twin-02", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample02", + "temp": 79, + "comfortIndex": 50 + } + }, + { + "Widget": { + "$dtId": "Twin-01", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample01", + "temp": 79, + "comfortIndex": 50 + }, + "Gadget": { + "$dtId": "Twin-10", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample10", + "temp": 79, + "comfortIndex": 50 + } + } + ] + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryNextPage.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryNextPage.json new file mode 100644 index 000000000000..0dc9a3381ab2 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/QueryNextPage.json @@ -0,0 +1,73 @@ +{ + "parameters": { + "querySpecification": { + "continuationToken": "" + }, + "api-version": "2022-05-31" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "$dtId": "Twin-04", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample04", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-05", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample05", + "temp": 79, + "comfortIndex": 50 + }, + { + "$dtId": "Twin-06", + "$metadata": { + "$lastUpdateTime": "2022-02-28T00:30:00.1234567Z", + "$model": "dtmi:com:example:Sample;1", + "name": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "temp": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + }, + "comfortIndex": { + "lastUpdateTime": "2022-02-28T00:30:00.1234567Z" + } + }, + "name": "Sample06", + "temp": 79, + "comfortIndex": 50 + } + ] + } + } + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetry.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetry.json new file mode 100644 index 000000000000..dd26c86b9196 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetry.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "Message-Id": "e5ca50dd-ca31-4fae-8d84-3af5a72b10c5", + "Telemetry-Source-Time": "1985-04-12T23:20:50.52Z", + "telemetry": { + "temperature": 1 + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetryFromComponent.json b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetryFromComponent.json new file mode 100644 index 000000000000..34453b334416 --- /dev/null +++ b/specification/digitaltwins/data-plane/Microsoft.DigitalTwins/stable/2022-05-31/examples/SendTelemetryFromComponent.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "api-version": "2022-05-31", + "id": "myTwinId", + "componentPath": "myComponent", + "Message-Id": "e5ca50dd-ca31-4fae-8d84-3af5a72b10c5", + "Telemetry-Source-Time": "1985-04-12T23:20:50.52Z", + "telemetry": { + "temperature": 1 + } + }, + "responses": { + "204": {} + } +} diff --git a/specification/digitaltwins/data-plane/readme.go.md b/specification/digitaltwins/data-plane/readme.go.md index 873f0bce838e..7355bf70bcbc 100644 --- a/specification/digitaltwins/data-plane/readme.go.md +++ b/specification/digitaltwins/data-plane/readme.go.md @@ -13,12 +13,22 @@ go: ```yaml $(go) && $(multiapi) batch: + - tag: package-2022-05-31 - tag: package-2021-06-30-preview - tag: package-2020-10-31 - tag: package-2020-05-31-preview ``` +### Tag: package-2022-05-31 and go + +These settings apply only when `--tag=package-2022-05-31 --go` is specified on the command line. +Please also specify `--go-sdks-folder=`. + +```yaml $(tag) == 'package-2022-05-31' && $(go) +output-folder: $(go-sdk-folder)/services/$(namespace)/2022-05-31/$(namespace) +``` + ### Tag: package-2021-06-30-preview and go These settings apply only when `--tag=package-2021-06-30-preview --go` is specified on the command line. diff --git a/specification/digitaltwins/data-plane/readme.md b/specification/digitaltwins/data-plane/readme.md index cc200dac2b57..234e232f0a99 100644 --- a/specification/digitaltwins/data-plane/readme.md +++ b/specification/digitaltwins/data-plane/readme.md @@ -24,16 +24,26 @@ For other options on installation see [Installing AutoRest](https://aka.ms/autor These are the global settings for Azure Digital Twins. -```yaml +``` yaml openapi-type: data-plane -tag: package-2021-06-30-preview +tag: package-2022-05-31 +``` + + +### Tag: package-2022-05-31 + +These settings apply only when `--tag=package-2022-05-31` is specified on the command line. + +```yaml $(tag) == 'package-2022-05-31' +input-file: + - Microsoft.DigitalTwins/stable/2022-05-31/digitaltwins.json ``` ### Tag: package-2021-06-30-preview These settings apply only when `--tag=package-2021-06-30-preview` is specified on the command line. -```yaml $(tag) == 'package-2021-06-30-preview' +``` yaml $(tag) == 'package-2021-06-30-preview' input-file: - Microsoft.DigitalTwins/preview/2021-06-30-preview/digitaltwins.json ``` @@ -42,7 +52,7 @@ input-file: These settings apply only when `--tag=package-2020-10-31` is specified on the command line. -```yaml $(tag) == 'package-2020-10-31' +``` yaml $(tag) == 'package-2020-10-31' input-file: - Microsoft.DigitalTwins/stable/2020-10-31/digitaltwins.json ``` @@ -51,7 +61,7 @@ input-file: These settings apply only when `--tag=package-2020-05-31-preview` is specified on the command line. -```yaml $(tag) == 'package-2020-05-31-preview' +``` yaml $(tag) == 'package-2020-05-31-preview' input-file: - Microsoft.DigitalTwins/preview/2020-05-31-preview/digitaltwins.json ``` @@ -65,7 +75,7 @@ input-file: This section describes what SDK should be generated by the automatic system. This is not used by Autorest itself. -```yaml $(swagger-to-sdk) +``` yaml $(swagger-to-sdk) swagger-to-sdk: - repo: azure-sdk-for-net-track2 ``` @@ -94,7 +104,7 @@ See configuration in [readme.csharp.md](./readme.csharp.md) See configuration in [readme.java.md](./readme.java.md) -## Multi-API/Profile support for AutoRest v3 generators +## Multi-API/Profile support for AutoRest v3 generators AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. @@ -110,11 +120,10 @@ input-file: ``` -If there are files that should not be in the `all-api-versions` set, +If there are files that should not be in the `all-api-versions` set, uncomment the `exclude-file` section below and add the file paths. ``` yaml $(tag) == 'all-api-versions' #exclude-file: # - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json ``` - diff --git a/specification/digitaltwins/data-plane/readme.python.md b/specification/digitaltwins/data-plane/readme.python.md index 58a54f9f038e..6bd18c8c3f10 100644 --- a/specification/digitaltwins/data-plane/readme.python.md +++ b/specification/digitaltwins/data-plane/readme.python.md @@ -12,6 +12,17 @@ python: clear-output-folder: true ``` +### Tag: package-2022-05-31 +These settings apply only when `--tag=package-2022-05-31` is specified on the command line. + +```yaml $(tag) == 'package-2022-05-31' && $(python) +python: + namespace: Azure.DigitalTwins.Core + package-name: digitaltwins + package-version: 2022-05-31 + output-folder: $(python-sdks-folder)/digitaltwins/2022-05-31 +``` + ### Tag: package-2021-06-30-preview These settings apply only when `--tag=package-2021-06-30-preview` is specified on the command line.