Skip to content

server/app/interfaces/repository.py: Implement missing /submodels/{submodelIdentifier}/submodel-elements/{idShortPath} endpoints #531

@moritzsommer

Description

@moritzsommer

Current Situation

Currently, several server endpoints under /submodels/{submodelIdentifier}/submodel-elements/{idShortPath} are not implemented:

"/$metadata", methods=["PATCH"], endpoint=self.not_implemented
"/$value", methods=["GET"], endpoint=self.not_implemented)
"/$value", methods=["PATCH"], endpoint=self.not_implemented
"/$path", methods=["GET"], endpoint=self.not_implemented
"/invoke", methods=["POST"], endpoint=self.not_implemented
"/invoke/$value", methods=["POST"], endpoint=self.not_implemented
"/invoke-async",  methods=["POST"], endpoint=self.not_implemented
"/invoke-async/$value",  methods=["POST"],  endpoint=self.not_implemented
"/operation-status/<base64url:handleId>", methods=["GET"], endpoint=self.not_implemented

According to the Submodel Repository Service OpenAPI Specification, the PATCH /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$metadata endpoint should update the metadata attributes of an existing Submodel Element.

[...]
responses:
        '204':
          description: SubmodelElement updated successfully
[...]

The GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$value endpoint should return a specific Submodel Element from the Submodel at a specified path in value only representation.

[...]
responses:
        '200':
          description: Requested submodel element
          content:
            application/json:
              schema:
                $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/schemas/SubmodelElementValue'
[...]

The PATCH /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$value endpoint should update the value of an existing Submodel Element.

[...]
responses:
        '204':
          description: Submodel updated successfully
[...]

The GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$path endpoint should return a specific Submodel Element from the Submodel at a specified path in path notation.

[...]
responses:
        '200':
          description: Requested submodel element
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/schemas/PathItem'
[...]

The POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke endpoint should synchronously or asynchronously invoke an operation at a specified path.

[...]
responses:
        '200':
          description: Operation result object
          content:
            application/json:
              schema:
                $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/schemas/OperationResult'
[...]

The POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke/$value endpoint should synchronously or asynchronously invoke an operation at a specified path.

[...]
responses:
        '200':
          description: Operation result object
          content:
            application/json:
              schema:
                $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/schemas/OperationResultValueOnly'
[...]

The POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke-async endpoint should asynchronously invoke an operation at a specified path.

[...]
responses:
        '202':
          $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/responses/accepted'
[...]

The POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke-async/$value endpoint should asynchronously invoke an operation at a specified path.

[...]
responses:
        '202':
          $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/responses/accepted'
[...]

The GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/operation-status/{handleId} endpoint should return the status of an asynchronously invoked operation.

[...]
responses:
        '200':
          description: Operation result object containing information that the 'executionState' is still 'Running'
          content:
            application/json:
              schema:
                $ref: 'https://api.swaggerhub.com/domains/Plattform_i40/Part2-API-Schemas/V3.0.1#/components/schemas/BaseOperationResult'
[...]

This issue specifies #439.

Proposed Change

We should evaluate and, if feasible, implement the nine missing
PATCH /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$metadata,
GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$value,
PATCH /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$value,
GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$path,
POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke,
POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke/$value,
POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke-async,
POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke-async/$value and
GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/operation-status/{handleId}
endpoints according to the specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new featureserverSomething to do with the `server` package

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions