Commit bc1e2655 authored by Muhammad Hamza's avatar Muhammad Hamza
Browse files

Add subs endpoints in CertificateManagement.yaml

parent 12ba3bef
Loading
Loading
Loading
Loading
Loading
+430 −0
Original line number Original line Diff line number Diff line
@@ -333,6 +333,136 @@ paths:
        "504":
        "504":
          $ref: ../responses/SOL023_resp.yaml#/responses/504
          $ref: ../responses/SOL023_resp.yaml#/responses/504


####################################################################### 
###################### Subscriptions Endpoints ########################
####################################################################### 

  /subscriptions:
    parameters:
      - $ref: ../components/SOL023_params.yaml#/components/parameters/Accept
      - $ref: ../components/SOL023_params.yaml#/components/parameters/ContentType
    
    post:
      description: |
        The POST method creates a new subscription. See clause 7.5.3.3.1.
      requestBody:
        $ref: "#/components/requestBodies/CertificateSubscriptionRequest"
      responses:
        201:
          $ref: '#/components/responses/Subscriptions.Post.201'
        303:
          $ref: '#/components/responses/Subscriptions.Post.303'
        400:
          $ref: "../responses/SOL023_resp.yaml#/responses/400"
        401:
          $ref: "../responses/SOL023_resp.yaml#/responses/401"
        403:
          $ref: "../responses/SOL023_resp.yaml#/responses/403"
        404:
          $ref: "../responses/SOL023_resp.yaml#/responses/404"
        405:
          $ref: "../responses/SOL023_resp.yaml#/responses/405"
        422:
          $ref: '#/components/responses/Subscriptions.Post.422'
        406:
          $ref: "../responses/SOL023_resp.yaml#/responses/406"
        500:
          $ref: "../responses/SOL023_resp.yaml#/responses/500"
        503:
          $ref: "../responses/SOL023_resp.yaml#/responses/503"
        504:
          $ref: "../responses/SOL023_resp.yaml#/responses/504"

    get:
      description: |

      parameters:
        - $ref: '#/components/parameters/filter_subscriptions'
        - $ref: ../components/SOL023_params.yaml#/components/parameters/nextpage_opaque_marker_cmf
      responses:
        200:
          $ref: '#/components/responses/Subscriptions.Get.200'
        400:
          $ref: "../responses/SOL023_resp.yaml#/responses/400"
        401:
          $ref: "../responses/SOL023_resp.yaml#/responses/401"
        403:
          $ref: "../responses/SOL023_resp.yaml#/responses/403"
        404:
          $ref: "../responses/SOL023_resp.yaml#/responses/404"
        405:
          $ref: "../responses/SOL023_resp.yaml#/responses/405"
        422:
          $ref: "../responses/SOL023_resp.yaml#/responses/422"
        406:
          $ref: "../responses/SOL023_resp.yaml#/responses/406"
        500:
          $ref: "../responses/SOL023_resp.yaml#/responses/500"
        503:
          $ref: "../responses/SOL023_resp.yaml#/responses/503"
        504:
          $ref: "../responses/SOL023_resp.yaml#/responses/504"

  /subscriptions/{subscriptionId}:
    parameters:
      - $ref: '#/components/parameters/SubscriptionId'
      - $ref: ../components/SOL023_params.yaml#/components/parameters/Version
      - $ref: ../components/SOL023_params.yaml#/components/parameters/Authorization
    
    get:
      description: |
        The GET method reads an individual subscription. See clause 11.4.3.3.2.
      responses:
        200:
          $ref: '#/components/responses/IndividualSubscription.Get.200'
        400:
          $ref: "../responses/SOL023_resp.yaml#/responses/400"
        401:
          $ref: "../responses/SOL023_resp.yaml#/responses/401"
        403:
          $ref: "../responses/SOL023_resp.yaml#/responses/403"
        404:
          $ref: "../responses/SOL023_resp.yaml#/responses/404"
        405:
          $ref: "../responses/SOL023_resp.yaml#/responses/405"
        422:
          $ref: "../responses/SOL023_resp.yaml#/responses/422"
        406:
          $ref: "../responses/SOL023_resp.yaml#/responses/406"
        500:
          $ref: "../responses/SOL023_resp.yaml#/responses/500"
        503:
          $ref: "../responses/SOL023_resp.yaml#/responses/503"
        504:
          $ref: "../responses/SOL023_resp.yaml#/responses/504"

    delete:
      description: |
        The DELETE method terminates an individual subscription. See clause 11.4.3.3.5.
      responses:
        204:
          $ref: '#/components/responses/IndividualSubscription.Delete.204'
        400:
          $ref: "../responses/SOL023_resp.yaml#/responses/400"
        401:
          $ref: "../responses/SOL023_resp.yaml#/responses/401"
        403:
          $ref: "../responses/SOL023_resp.yaml#/responses/403"
        404:
          $ref: "../responses/SOL023_resp.yaml#/responses/404"
        405:
          $ref: "../responses/SOL023_resp.yaml#/responses/405"
        422:
          $ref: "../responses/SOL023_resp.yaml#/responses/422"
        406:
          $ref: "../responses/SOL023_resp.yaml#/responses/406"
        500:
          $ref: "../responses/SOL023_resp.yaml#/responses/500"
        503:
          $ref: "../responses/SOL023_resp.yaml#/responses/503"
        504:
          $ref: "../responses/SOL023_resp.yaml#/responses/504"

components:
components:
  parameters:
  parameters:
    filter_subject_instances:
    filter_subject_instances:
@@ -419,6 +549,38 @@ components:
      schema:
      schema:
        type: string
        type: string


############################# For Subscriptions Resources #############################
    
    filter_subscriptions:
      name: filter
      description: >
        Attribute-based filtering expression according to clause 5.2 of ETSI GS NFV SOL 013 [4].

        The CMF shall support receiving this parameter as part of the URI query string. The VNFM
        may supply this parameter.

        All attribute names that appear in the CertificateSubscription and in data types referenced
        from it shall be supported by the CMF in the filter expression.
      in: query
      required: false
      schema:
        type: string

    SubscriptionId:
      name: subscriptionId
      in: path
      description: |
        Identifier of this subscription.
        This identifier can be retrieved from the resource referenced by the
        "Location" HTTP header in the response to a POST request creating a
        new "Individual subscription" resource. It can also be retrieved from the "id"
        attribute in the message content of that response.
      required: true
      style: simple
      explode: false
      schema:
        type: string
  
  responses:
  responses:
    SubjectInstance.Post.201:
    SubjectInstance.Post.201:
      description: >
      description: >
@@ -977,6 +1139,261 @@ components:
          schema:
          schema:
            $ref: "../definitions/SOL023_def.yaml#/definitions/ProblemDetails"
            $ref: "../definitions/SOL023_def.yaml#/definitions/ProblemDetails"


    ####################################################################### 
    ################ Subscriptions Endpoints Response Bodies ##############
    ####################################################################### 
    
    Subscriptions.Post.201:
      description: |
        201 CREATED

        Shall be returned when the subscription has been created successfully.

        The response body shall contain a representation of the created "Individual subscription" resource.

        The HTTP response shall include a "Location" HTTP header that points to the created
        "Individual subscription" resource.
      headers:
        Version:
          description: |
            The used API version.
          style: simple
          explode: false
          schema:
            type: string
        WWW-Authenticate:
          description: |
            Challenge if the corresponding HTTP request has not provided authorization, or error details if the
            corresponding HTTP request has provided an invalid authorization token.
          style: simple
          explode: false
          schema:
            type: string
        Content-Type:
          description: |
            The MIME type of the body of the response.
          style: simple
          explode: false
          schema:
            type: string
        Location:
          description: |
            The resource URI of the created VNF instance
          style: simple
          explode: false
          schema:
            type: string
            format: url
      content:
        application/json:
          schema:
            $ref: ./definitions/SOL023CertificateManagement_def.yaml#/definitions/CertificateSubscription

    Subscriptions.Post.303:
      description: |
        303 See Other

        Shall be returned if a subscription with the same callback URI and the same filter already exists and
        the policy of the CMF is to not create redundant subscriptions.

        The HTTP response shall include a "Location" HTTP header that contains the resource URI of the existing
        "Individual subscription" resource.

        The response body shall be empty.
      headers:
        Version:
          description: |
            The used API version.
          style: simple
          explode: false
          schema:
            type: string
        WWW-Authenticate:
          description: |
            Challenge if the corresponding HTTP request has not provided authorization, or error details if the
            corresponding HTTP request has provided an invalid authorization token.
          style: simple
          explode: false
          schema:
            type: string
        Content-Type:
          description: |
            The MIME type of the body of the response.
          style: simple
          explode: false
          schema:
            type: string
        Location:
          description: |
            The resource URI of the created VNF instance
          style: simple
          explode: false
          schema:
            type: string
            format: url

    Subscriptions.Post.422:
      description: |
        422 Unprocessable Content

        Shall be returned upon the following error: The content type of the message content is supported
        and the message content of a request contains syntactically correct data but the data cannot be processed.

        The general cause for this error and its handling is specified in clause 6.4 of ETSI GS NFV SOL 013,
        including rules for the presence of the response body.

        Specifically in case of this resource, the response code 422 shall also be returned if the CMF has tested
        the Notification endpoint as described in clause 7.5.5.3.2 and the test has failed. 

        In this case, the "detail" attribute in the "ProblemDetails" structure shall convey more information about
        the error.
      headers:
        Version:
          description: |
            The used API version.
          style: simple
          explode: false
          schema:
            type: string
        WWW-Authenticate:
          description: |
            Challenge if the corresponding HTTP request has not provided authorization, or error details if the
            corresponding HTTP request has provided an invalid authorization token.
          style: simple
          explode: false
          schema:
            type: string
        Content-Type:
          description: |
            The MIME type of the body of the response.
          style: simple
          explode: false
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../definitions/SOL023_def.yaml#/definitions/ProblemDetails"

    Subscriptions.Get.200:
      description: |
        200 OK

        Shall be returned when the list of subscriptions has been queried successfully.

        The response body shall contain in an array the representations of all active subscriptions
        of the functional block that invokes the method, i.e. zero or more representations of certificate
        change notification subscriptions as defined in clause X.X.X.X.

        If the "filter" URI parameter was supplied in the request, the data in the response body shall have
        been transformed according to the rules specified in clause 5.2.2 of ETSI GS NFV-SOL 013.

        If the CMF supports alternative 2 (paging) according to clause 5.4.2.1 of ETSI GS NFV SOL 013
        for this resource, inclusion of the Link HTTP header in this response shall follow the provisions in
        clause 5.4.2.3 of ETSI GS NFV SOL 013.
      headers:
        Version:
          description: |
            The used API version.
          style: simple
          explode: false
          schema:
            type: string
        WWW-Authenticate:
          description: |
            Challenge if the corresponding HTTP request has not provided authorization, or error details if the
            corresponding HTTP request has provided an invalid authorization token.
          style: simple
          explode: false
          schema:
            type: string
        Content-Type:
          description: |
            The MIME type of the body of the response.
          style: simple
          explode: false
          schema:
            type: string
        Link:
          description: |
            Reference to other resources. Used for paging in the present document, see clause 4.7.2.1.
          style: simple
          explode: false
          schema:
            type: string
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: ./definitions/SOL023CertificateManagement_def.yaml#/definitions/CertificateSubscription

    IndividualSubscription.Get.200:
      description: | 
        200 OK

        Shall be returned when information about an individual subscription has been read successfully.

        The response body shall contain a representation of the "Individual subscription" resource.
      headers:
        Version:
          description: |
            The used API version.
          style: simple
          explode: false
          schema:
            type: string
        WWW-Authenticate:
          description: |
            Challenge if the corresponding HTTP request has not provided authorization, or error details if the
            corresponding HTTP request has provided an invalid authorization token.
          style: simple
          explode: false
          schema:
            type: string
        Content-Type:
          description: |
            The MIME type of the body of the response.
          style: simple
          explode: false
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: ./definitions/SOL023CertificateManagement_def.yaml#/definitions/CertificateSubscription

    IndividualSubscription.Delete.204:
      description: | 
        No Content

        Shall be returned when the "Individual subscription" resource has been deleted successfully.

        The response body shall be empty.
      headers:
        Version:
          description: |
            The used API version.
          style: simple
          explode: false
          schema:
            type: string
        WWW-Authenticate:
          description: |
            Challenge if the corresponding HTTP request has not provided authorization, or error details if the
            corresponding HTTP request has provided an invalid authorization token.
          style: simple
          explode: false
          schema:
            type: string
        Content-Type:
          description: |
            The MIME type of the body of the response.
          style: simple
          explode: false
          schema:
            type: string

  requestBodies:
  requestBodies:
    CreateSubjectRequest:
    CreateSubjectRequest:
      description: >
      description: >
@@ -995,3 +1412,16 @@ components:
          schema:
          schema:
            $ref: "./definitions/SOL023CertificateManagement_def.yaml#/definitions/CSRRequest"
            $ref: "./definitions/SOL023CertificateManagement_def.yaml#/definitions/CSRRequest"
      required: true
      required: true

    ####################################################################### 
    ################ Subscriptions Endpoints Request Bodies ###############
    ####################################################################### 

    CertificateSubscriptionRequest:
      description: |
        Details of the subscription to be created.
      content:
        application/json:
          schema:
            $ref: "./definitions/SOL023CertificateManagement_def.yaml#/definitions/CertificateSubscriptionRequest"
      required: true
 No newline at end of file