Unverified Commit 494982da authored by Daniel González-Sánchez's avatar Daniel González-Sánchez Committed by GitHub
Browse files

Merge pull request #3 from giros-dit/1.6.1-ops-batch

NGSI-LD Batch Operations - OAS 1.6.1
parents 3ba1f8b4 244ae197
Loading
Loading
Loading
Loading
+131 −143
Original line number Diff line number Diff line
@@ -1320,7 +1320,7 @@ paths:
      tags:
        - Context Information Provision
      summary: |
        Batch Entity creation
        Batch Entity Creation
      description: |
        5.6.7 Batch Entity Creation.

@@ -1347,14 +1347,14 @@ paths:
                    - type
          application/json+ld:
            schema:
              allOf:
                - type: array
              type: array
              items:
                    $ref: '#/components/schemas/Entity'
                allOf:
                  - type: object
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/Entity'
                  - required:
                    - id
                    - type
@@ -1374,19 +1374,9 @@ paths:
                type: array
                items:
                  type: string
            application/json+ld:
              schema:
                allOf:
                  - type: object
                    required:
                      - '@context'
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - type: array
                    items:
                      type: string
        '207':
          allOf:
            - $ref: '#/components/responses/MultiStatus.BatchOperationResult'
          description: |
            If only some or none of the entities have been successfully created, a response body containing the
            result of each operation contained in the batch is returned in a BatchOperationResult structure.
@@ -1403,7 +1393,6 @@ paths:
            is returned in a BatchOperationResult structure.

            Errors can occur whenever a distributed operation is unsupported, fails or times out, see clause 6.3.17.
          $ref: '#/components/responses/MultiStatus.BatchOperationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
  /entityOperations/upsert:
@@ -1411,7 +1400,7 @@ paths:
      tags:
        - Context Information Provision
      summary: |
        Batch Entity create or update (upsert)
        Batch Entity Creation or Update (Upsert)
      description: |
        5.6.8 Batch Entity Upsert.

@@ -1441,14 +1430,14 @@ paths:
                    - type
          application/json+ld:
            schema:
              allOf:
                - type: array
              type: array
              items:
                    $ref: '#/components/schemas/Entity'
                allOf:
                  - type: object
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/Entity'
                  - required:
                    - id
                    - type
@@ -1470,11 +1459,6 @@ paths:
                type: array
                items:
                  type: string
            application/json+ld:
              schema:
                type: array
                items:
                  type: string
        '204':
          description: |
            If all entities already existed and are successfully updated, there is no payload body in the response.
@@ -1482,12 +1466,14 @@ paths:
            NGSILD-Tenant:
              $ref: '#/components/headers/NGSILD-Tenant'
        '207':
          allOf:
            - $ref: '#/components/responses/MultiStatus.BatchOperationResult'
          description: |
            If only some or none of the entities have been successfully created, a response body containing the
            If only some or none of the entities have been successfully created or updated, a response body containing the
            result of each operation contained in the batch is returned in a BatchOperationResult structure.
            It contains two arrays. The first array ('success') contains the URIs of the successfully created entities,
            It contains two arrays. The first array ('success') contains the URIs of the successfully created or updated entities,
            while the second array ('errors') contains information about the error for each
            of the entities that could not be created. There is no restriction
            of the entities that could not be created or updated. There is no restriction
            as to the order of the Entity Ids in the arrays.

            If any of the entities matches to a registration, the relevant parts of the request
@@ -1498,7 +1484,6 @@ paths:
            is returned in a BatchOperationResult structure.

            Errors can occur whenever a distributed operation is unsupported, fails or times out, see clause 6.3.17.
          $ref: '#/components/responses/MultiStatus.BatchOperationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
  /entityOperations/update:
@@ -1506,7 +1491,7 @@ paths:
      tags:
        - Context Information Provision
      summary: |
        Batch Entity update
        Batch Entity Update
      description: |
        5.6.9 Batch Entity Update.

@@ -1535,14 +1520,14 @@ paths:
                    - type
          application/json+ld:
            schema:
              allOf:
                - type: array
              type: array
              items:
                    $ref: '#/components/schemas/Entity'
                allOf:
                  - type: object
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/Entity'
                  - required:
                    - id
                    - type
@@ -1550,28 +1535,42 @@ paths:
      responses:
        '204':
          description: |
            If all entities already existed and are successfully updated, there is no payload body in the response.
            If all entities have been successfully updated, there is no payload body in the response. 
          headers:
            NGSILD-Tenant:
              $ref: '#/components/headers/NGSILD-Tenant'
        '207':
          description: |
            If only some or none of the entities have been successfully created, a response body containing the
            result of each operation contained in the batch is returned in a BatchOperationResult structure.
            It contains two arrays. The first array ('success') contains the URIs of the successfully created entities,
            while the second array ('errors') contains information about the error for each
            of the entities that could not be created. There is no restriction
            as to the order of the Entity Ids in the arrays.
          allOf:
            - $ref: '#/components/responses/MultiStatus.BatchOperationResult'
          description: |
            If only some or none of the entities have
            been successfully updated, a response
            body containing the result of each operation
            contained in the batch is returned in a
            BatchOperationResult structure. It contains
            two arrays. The first array ('success')
            contains the URIs of the successfully
            updated entities, while the second array
            ('errors') contains information about the
            error for each of the entities that could not
            be updated. There is no restriction as to the
            order of the Entity Ids in the arrays.

            If any of the entities matches to a registration, the relevant parts of the request
            are forwarded as a distributed operation.
            If any of the entities matches to a
            registration, the relevant parts of the
            request are forwarded as a distributed
            operation.

            In the case when an error response is received back from any distributed operation,
            a response body containing the result returned from each registration
            is returned in a BatchOperationResult structure.
            In the case when an error response is
            received back from any distributed
            operation, a response body containing the
            result returned from each registration is
            returned in a BatchOperationResult
            structure.

            Errors can occur whenever a distributed operation is unsupported, fails or times out, see clause 6.3.17.
          $ref: '#/components/responses/MultiStatus.BatchOperationResult'
            Errors can occur whenever a distributed
            operation is unsupported, fails or times out,
            see clause 6.3.17. 
        '400':
          $ref: '#/components/responses/BadRequest'
  /entityOperations/delete:
@@ -1579,7 +1578,7 @@ paths:
      tags:
        - Context Information Provision
      summary: |
        Batch Entity delete
        Batch Entity Delete
      description: |
        5.6.10 Batch Entity Delete.

@@ -1599,25 +1598,7 @@ paths:
            schema:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/Entity'
                  - required:
                    - id
                    - type
          application/json+ld:
            schema:
              allOf:
                - type: array
                  items:
                    $ref: '#/components/schemas/Entity'
                - type: object
                  properties:
                    '@context':
                      $ref:  '#/components/schemas/LdContext'
                - required:
                  - id
                  - type
                  - '@context'
                type: string
      responses:
        '204':
          description: |
@@ -1626,6 +1607,8 @@ paths:
            NGSILD-Tenant:
              $ref: '#/components/headers/NGSILD-Tenant'
        '207':
          allOf:
            - $ref: '#/components/responses/MultiStatus.BatchOperationResult'
          description: |
            If some or all of the entities have not been successfully deleted, or did not exist,
            a response body containing the result of each operation contained in the batch is returned
@@ -1643,7 +1626,6 @@ paths:
            fails or times out, see clause 6.3.17.

            Errors can occur whenever a distributed operation is unsupported, fails or times out, see clause 6.3.17.
          $ref: '#/components/responses/MultiStatus.BatchOperationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
  /entityOperations/query:
@@ -1654,16 +1636,43 @@ paths:
        Query entities based on POST
      description: |
        5.7.2 Query Entity.

        This operation allows querying an NGSI-LD system.
      operationId: queryBatch
      parameters:
        # Local Query param
        - $ref: '#/components/parameters/Query.count'
        - $ref: '#/components/parameters/Query.limit'
        - $ref: '#/components/parameters/Query.local'
        - name: options
          in: query
          style: form
          explode: false
          schema:
            type: array
            items:
              allOf:
                - $ref: '#/components/schemas/options.representation'
                - $ref: '#/components/schemas/options.sysAttrs'
        # Request headers
        - $ref: '#/components/parameters/Headers.Link'
        - $ref: '#/components/parameters/Headers.ngsildTenant'
      requestBody:
        description: Payload body in the request contains a JSON-LD object which represents the query to be performed.
        $ref: '#/components/requestBodies/Query'
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Query'
          application/json+ld:
            schema:
              allOf:
                - type: object
                  properties:
                    '@context':
                      $ref:  '#/components/schemas/LdContext'
                - $ref: '#/components/schemas/Query'
                - required:
                  - '@context'
      responses:
        '200':
          description: |
@@ -1686,15 +1695,18 @@ paths:
                type: array
                items:
                  allOf:
                    - $ref: '#/components/schemas/Entity'
                    - type: object
                      properties:
                        '@context':
                          $ref:  '#/components/schemas/LdContext'
                    - $ref: '#/components/schemas/Entity'
                    - required:
                        - id
                        - type
                        - '@context'
            application/geo+json:
              schema:
                  $ref: '#/components/schemas/FeatureCollection'
        '400':
          $ref: '#/components/responses/BadRequest'
  /entityOperations/merge:
@@ -1702,7 +1714,7 @@ paths:
      tags:
        - Context Information Provision
      summary: |
        Batch Entity merge
        Batch Entity Merge
      description: |
        5.6.20 Batch Entity Merge.

@@ -1731,14 +1743,14 @@ paths:
                    - type
          application/json+ld:
            schema:
              allOf:
                - type: array
              type: array
              items:
                    $ref: '#/components/schemas/Entity'
                allOf:
                  - type: object
                    properties:
                      '@context':
                        $ref:  '#/components/schemas/LdContext'
                  - $ref: '#/components/schemas/Entity'
                  - required:
                    - id
                    - type
@@ -1751,6 +1763,8 @@ paths:
            NGSILD-Tenant:
              $ref: '#/components/headers/NGSILD-Tenant'
        '207':
          allOf:
            - $ref: '#/components/responses/MultiStatus.BatchOperationResult'
          description: |
            If only some or none of the entities have been successfully merged, a response body containing the
            result of each operation contained in the batch is returned in a BatchOperationResult structure.
@@ -1767,7 +1781,6 @@ paths:
            is returned in a BatchOperationResult structure.

            Errors can occur whenever a distributed operation is unsupported, fails or times out, see clause 6.3.17.
          $ref: '#/components/responses/MultiStatus.BatchOperationResult'
        '400':
          $ref: '#/components/responses/BadRequest'
  /temporal/entities:
@@ -3229,21 +3242,6 @@ components:
                    $ref:  '#/components/schemas/LdContext'
              - required:
                - '@context'
    Query:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Query'
        application/json+ld:
          schema:
            allOf:
              - $ref: '#/components/schemas/Query'
              - type: object
                properties:
                  '@context':
                    $ref:  '#/components/schemas/LdContext'
              - required:
                - '@context'
    QueryTemporal:
      content:
        application/json:
@@ -3508,7 +3506,7 @@ components:
            $ref: '#/components/schemas/BatchEntityError'
      required:
        - success
        - error
        - errors
    CsourceNotification:
      description: |
        5.3.2 This datatype represents the parameters that allow building a Context Source Notification
@@ -4708,7 +4706,7 @@ components:
    Query:
      description: |
        5.2.23 This datatype represents the information that is required in order to convey
        a query when a "Query Entities" operation is to be performed (as pe clause 5.7.2).
        a query when a "Query Entities" operation is to be performed (as per clause 5.7.2).
      type: object
      properties:
        type:
@@ -5118,12 +5116,6 @@ components:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
        application/json+ld:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
        application/geo:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    Conflict:
      description: |
        It is used to indicate that the entity or an exclusive or redirect
@@ -5157,9 +5149,6 @@ components:
        application/json:
          schema:
            $ref: '#/components/schemas/BatchOperationResult'
        application/json+ld:
          schema:
            $ref: '#/components/schemas/BatchOperationResult'
    MultiStatus.UpdateResult:
      description: |
        Only the Attributes included in the response payload body were successfully appended.
@@ -5168,7 +5157,9 @@ components:
        forwarded as a distributed operation.

        In the case when an error response is received back from any distributed operation, a response
        body containing the result returned from each registration is returned in a BatchOperationResult structure.
        body containing the result returned from each registration is returned in a UpdateResult structure.

        Names of the Attributes included in the UpdateResult structure are represented as Fully Qualified Names as per clause 6.3.6.

        Errors can occur whenever a distributed operation is unsupported, fails or times out, see clause 6.3.17.
      headers:
@@ -5178,9 +5169,6 @@ components:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateResult'
        application/json+ld:
          schema:
            $ref: '#/components/schemas/UpdateResult'
    NotFound:
      description: |
        It is used when a client provided an entity identifier (URI) not known