PolicyManagement.yaml 59.7 KB
Newer Older
openapi: 3.0.2
info:
  version: 1.0.0-impl:etsi.org:ETSI_NFV_OpenAPI:1
  title: SOL012 - Policy Management Interface
  description: >
    SOL012 - Policy Management Interface

    IMPORTANT: Please note that this file might be not aligned to the current version of the ETSI Group Specification
    it refers to. In case of discrepancies the published ETSI Group Specification takes precedence.

    Please report bugs to https://forge.etsi.org/rep/nfv/SOL012/issues
  license:
    name: ETSI Forge copyright notice
    url: https://forge.etsi.org/etsi-forge-copyright-notice.txt
externalDocs:
  description: ETSI GS NFV-SOL 012 v3.4.1
  url: https://docbox.etsi.org/ISG/NFV/Open/Drafts/SOL012ed331_Protocol_Spec_for_Policy_Mgmt_Intface/NFV-SOL012ed341v011.zip

security:
  - OauthSecurity:
      - all
servers:
  - url: http://127.0.0.1/nfvpolicy/v1
  - url: https://127.0.0.1/nfvpolicy/v1

paths:
  "/api_versions":
    $ref: '../endpoints/SOL012_endpoints.yaml#/endpoints/api_versions'

  "/policies":
    description: >-
      This resource represents policies. The API consumer can use this resource to create a policy, and to query multiple policies.
    post:
      description: >-
        The POST method creates a new individual policy resource.
        This method shall follow the provisions specified in the tables 5.5.3.3.1-1 and 5.5.3.3.1-2 for URI query parameters,
        request and response data structures, and response codes.
        As the result of successfully executing this method, a new "individual policy" resource as defined in clause
        5.5.4 shall have been created, and the value of the "activationStatus" attribute in the representation of that
        resource shall be "DEACTIVATED". A notification of type PolicyChangeNotification shall be triggered as part of
        successfully executing this method as defined in clause 5.6.2.7.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Version"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/ContentType"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      requestBody:
        $ref: "#/components/requestBodies/CreatePolicyRequest"
          $ref: '#/components/responses/Policy.Post.201'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
Giacomo Bernini's avatar
Giacomo Bernini committed
    get:
      description: >-
        The GET method queries information about multiple policies.
        This method shall follow the provisions specified in the tables 5.5.3.3.2-1 and 5.5.3.3.2-2
        for URI query parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/filter"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/nextpage_opaque_marker"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Version"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "200":
          $ref: '#/components/responses/Policy.Get.200'
          $ref: '#/components/responses/Policy.Get.400'
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504

  "/policies/{policyId}":
    description: >
      This resource represents an individual policy. The API consumer can use this resource to modify an individual
      policy, to read information about the policy and delete the policy.
    parameters:
      - $ref: '#/components/parameters/policyId'
    get:
      description: >
        The GET method retrieves information about a policy by reading an individual policy resource.
        This method shall follow the provisions specified in the tables 5.5.4.3.2-1 and 5.5.4.3.2-2 for URI
        query parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "200":
          $ref: '#/components/responses/IndividualPolicy.Get.200'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
    patch:
      description: >
        The PATCH method modifies a policy.
        This method shall follow the provisions specified in the tables 5.5.4.3.4-1 and 5.5.4.3.4-2 for URI
        query parameters, request and response data structures, and response codes.
        Modification of a policy includes three functionalities: activating/deactivating the policy,
        changing the associations of the policy, and changing the selected version of the policy.
        The three functionalities may be combined flexibly in one request unless there's conflict with
        the state of the policy.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/ContentType"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      requestBody:
        $ref: "#/components/requestBodies/ModifyPolicyRequest"
      responses:
        "200":
          $ref: '#/components/responses/PolicyModifications.Patch.200'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "409":
          $ref: '#/components/responses/PolicyModifications.Patch.409'
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504

    delete:
      description: >
        The DELETE method deletes an individual policy.
        This method shall follow the provisions specified in the tables 5.5.4.3.5-1 and 5.5.4.3.5-2 for URI
        query parameters, request and response data structures, and response codes.
        As the result of successfully executing this method, the "individual policy" resource shall not exist
        any longer. A notification of type "PolicyChangeNotification" shall be triggered as part of successfully
        executing this method as defined in clause 5.6.2.7.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "204":
          $ref: '#/components/responses/Policy.Delete.204'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "409":
          $ref: '#/components/responses/Policy.Delete.409'
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504

  "/policies/{policyId}/selected_versions":
    description: >
      This resource represents the selected version of an individual policy. The API consumer can use this resource
      to read the content of the selected version of the policy.
      The selected version is the version to be used when activating the policy and is then enforced as long as the
      policy is in ACTIVATED state.
    parameters:
      - $ref: '#/components/parameters/policyId'
    get:
      description: >
        The GET method fetches the content of the selected version of an individual policy.
        This method shall follow the provisions specified in the tables 5.5.5.3.2-1 and 5.5.5.3.2-2 for URI query
        parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "200":
          $ref: '#/components/responses/PolicySelectedVersion.Get.200'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: '#/components/responses/PolicySelectedVersion.Get.404'
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504

  "/policies/{policyId}/versions/{version}":
    description: >
      This resource represents a particular version of an individual policy. The API consumer can use this resource
      to transfer the content, read the content and delete a particular version of a policy.
    parameters:
      - $ref: '#/components/parameters/policyId'
      - $ref: '#/components/parameters/version'
    get:
      description: >
        The GET method fetches the content of a particular version of an individual policy.
        This method shall follow the provisions specified in the tables 5.5.6.3.2-1 and 5.5.6.3.2-2 for URI
        query parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "200":
          $ref: '#/components/responses/IndividualPolicyVersion.Get.200'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
    put:
      description: >
        The PUT method transfers the content of a particular version of an individual policy.
        This method shall follow the provisions specified in the tables 5.5.6.3.3-1 and 5.5.6.3.3-2 for
        URI query parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/ContentType"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      requestBody:
        $ref: '#/components/requestBodies/PolicyVersionTransferRequest'
      responses:
        "201":
          $ref: '#/components/responses/PolicyVersionTransfer.Put.201'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "409":
          $ref: '#/components/responses/PolicyVersionTransfer.Put.409'
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
    delete:
      description: >
        The DELETE method deletes a particular version of an individual policy.
        This method shall follow the provisions specified in the tables 5.5.6.3.5-1 and 5.5.6.3.5-2 for URI query
        parameters, request and response data structures, and response codes.
        As the result of successfully executing this method, the "particular version of an individual policy" resource
        shall be deleted. It's not allowed to delete the selected version of the individual policy.
        A notification of type "PolicyChangeNotification" shall be triggered as part of successfully executing this
        method as defined in clause 5.6.2.8.
      responses:
        "204":
          $ref: '#/components/responses/PolicyVersion.Delete.204'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "409":
          $ref: '#/components/responses/PolicyVersion.Delete.409'
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
  "/subscriptions":
    description: >-
      This resource represents subscriptions. The API consumer can use this resource to subscribe to notifications 
      related to policy changes and any detected policy conflicts, and to query its subscriptions.
    post:
      description: >-
        The POST method creates a new subscription.
        This method shall follow the provisions specified in the tables 5.5.7.3.1-1 and 5.5.7.3.1-2 for URI query parameters, 
        request and response data structures, and response codes.
        As the result of successfully executing this method, a new "Individual subscription" resource as defined in clause 5.5.6 
        shall have been created. This method shall not trigger any notification.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Version"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/ContentType"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      requestBody:
        $ref: '#/components/requestBodies/PolicySubscriptionCreateRequest'
      responses:
        "201":
          $ref: '#/components/responses/Subscriptions.Post.201'
          $ref: '#/components/responses/Subscriptions.Post.303'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
    get:
      description: >-
        The GET method queries the list of active subscriptions of the functional block that invokes the method. 
        It can be used e.g. for resynchronization after error situations. 
        This method shall follow the provisions specified in the tables 5.5.7.3.2-1 and 5.5.7.3.2-2 for 
        URI query parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Version"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/filter"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/nextpage_opaque_marker"
      responses:
        "200":
          $ref: '#/components/responses/Subscriptions.Get.200'
          $ref: '#/components/responses/Subscriptions.Get.400'
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
  "/subscriptions/{subscriptionId}":
    description: >-
      This resource represents an individual subscription. The API consumer can use this resource to read and to 
      terminate a subscription to notifications related to policy management.
    parameters:
      - $ref: '#/components/parameters/subscriptionId'
    get:
      description: >-
        The GET method retrieves information about a subscription by reading an "Individual subscription" resource.
        This method shall follow the provisions specified in the tables 5.5.8.3.2-1 and 5.5.8.3.2-2 for URI query 
        parameters, request and response data structures, and response codes.
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Version"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Accept"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "200":
          $ref: '#/components/responses/IndividualSubscription.Get.200'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
    delete:
      description: >-
        The DELETE method terminates an individual subscription. This method shall follow the provisions specified 
        in the tables 5.5.8.3.5-1 and 5.5.8.3.5-2 for URI query parameters, request and response data structures, 
        and response codes.
        As the result of successfully executing this method, the "Individual subscription" resource shall not exist 
        any longer. This means that no notifications for that subscription shall be sent to the formerly-subscribed 
        API consumer. 
      parameters:
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Version"
        - $ref: "../components/SOL012_params.yaml#/components/parameters/Authorization"
      responses:
        "204":
          $ref: '#/components/responses/IndividualSubscription.Delete.204'
        "400":
          $ref: ../components/SOL012_resp.yaml#/components/responses/400
        "401":
          $ref: ../components/SOL012_resp.yaml#/components/responses/401
        "403":
          $ref: ../components/SOL012_resp.yaml#/components/responses/403
        "404":
          $ref: ../components/SOL012_resp.yaml#/components/responses/404
        "405":
          $ref: ../components/SOL012_resp.yaml#/components/responses/405
        "406":
          $ref: ../components/SOL012_resp.yaml#/components/responses/406
        "409":
          $ref: ../components/SOL012_resp.yaml#/components/responses/409
        "422":
          $ref: ../components/SOL012_resp.yaml#/components/responses/422
        "500":
          $ref: ../components/SOL012_resp.yaml#/components/responses/500
        "503":
          $ref: ../components/SOL012_resp.yaml#/components/responses/503
        "504":
          $ref: ../components/SOL012_resp.yaml#/components/responses/504
      
components:
  parameters:
    policyId:
      name: policyId
      description: >
        Identifier of the policy. 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 policy" resource. It can also be retrieved
        from the "id" attribute in the payload body of that response.
      in: path
      required: true
      schema:
        $ref: '../components/SOL012_schemas.yaml#/components/schemas/Identifier'

    version:
      name: version
      description: >
        Version of the policy. This URI variable is provided by the API consumer in a PUT request creating the new
        particular version of an individual policy resource. It can be retrieved from the "versions" attribute in the
        payload body of the response to a GET request to the “individual policy” resource.
      in: path
      required: true
      schema:
        type: string

    subscriptionId:
      name: subscriptionId
      description: >
        Identifier of the 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 payload body of that response.
      in: path
      required: true
      schema:
        $ref: '../components/SOL012_schemas.yaml#/components/schemas/Identifier'

  schemas:
    CreatePolicyRequest:
      description: >
        This type represents request parameters for creating a policy. It shall comply with the provisions defined
        in table 5.6.2.2-1.
      type: object
      properties:
        designer:
          description: >
            Human readable name of the designer of the policy.
          type: string
        name:
          description: >
            Human readable name of the policy.
          type: string
        pfId:
          description: >
            Identifier of the Policy Function (PF) which enforces the policy. Shall be present when the
            PF is not the API producer and shall be absent otherwise.
            Shall be absent when the API producer is NFVO-N.
            More information concerning the PF can be found in ETSI GR NFV-IFA 023 [i.2].
            For example, the PF can be a VNFM or VIM when the API producer is an NFVO.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
        associations:
          description: >
            Initial value of the “associations” attribute in the “Policy” data structure which represents the policy.
            Shall be absent when the association feature is not applicable for the PF.
            The associations refer to identifiers of entities that the PF manages. E.g., if the PF is a VNFM,
            the policy can associate to VNF instances; if the PF is NFVO, the policy can associate to an NS instances.
            How the PF determines the scope of applicability of the policy when this attribute is absent is
            outside the scope of the present document.
          type: array
          items:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
      required:
        - designer
        - name

    Policy:
      description: >-
        This type represents an individual policy. It shall comply with the provisions defined in table 5.6.2.3-1.
      type: object
      properties:
        id:
          description: >
            Identifier of the policy.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
        designer:
          description: >
            Human readable name of the designer of the policy.
          type: string
        name:
          description: >
            Human readable name of the policy.
          type: string
        pfId:
          description: >
            Identifier of the Policy Function (PF) which enforces the policy. Shall be present when the PF is not
            the API producer and shall be absent otherwise.
            Shall be absent when the API producer is NFVO-N.
            More information concerning the PF can be found in ETSI GR NFV-IFA 023 [i.2].
            For example, the PF can be a VNFM or VIM when the API producer is an NFVO.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
        versions:
          description: >
            Versions of the policy. Shall be present if at least one version of the policy has been transferred.
          type: array
          items:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/Version"
        selectedVersion:
          description: >
            Selected version of the policy. Shall be present if one or more versions of the policy have been transferred.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Version"
        activationStatus:
          description: >
            Status of the policy on whether it is activated or deactivated.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/ActivationStatus"
        transferStatus:
          description: >
            Status of the policy on whether the content of the policy has been transferred.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/TransferStatus"
            Identifiers of the entities that the PF manages and to which the policy associates to.
            Shall be absent when the association feature is not applicable for the PF.
            The associations refer to identifiers of entities that the PF manages.
            E.g., if the PF is a VNFM, the policy can associate to VNF instances; if the PF is NFVO, the policy can
            associate to an NS instances.
            How the PF determines the scope of applicability of the policy when this attribute is absent is
            outside the scope of the present document.
          type: array
          items:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
        _links:
          description: >
            Links for this resource
          type: object
          properties:
            self:
              description: >
                URI of this resource
              $ref: "../components/SOL012_schemas.yaml#/components/schemas/Link"
            selected:
              description: >
                URI of the selected version of this policy, if exists.
              $ref: "../components/SOL012_schemas.yaml#/components/schemas/Link"
            versions:
              description: >
                URIs of all the transferred versions of this policy, if exists.
              type: array
              items:
                $ref: "../components/SOL012_schemas.yaml#/components/schemas/Link"
          required:
            - self
      required:
        - id
        - designer
        - name
        - activationStatus
    PolicySubscriptionRequest:
        This type represents a subscription request related to notifications about policy changes 
        and policy conflicts. It shall comply with the provisions defined in table 5.6.2.5-1.
      type: object
      properties:
        filter:
          description: >
            Filter settings for this subscription, to define the subset of all notifications this subscription relates to. 
            A particular notification is sent to the subscriber if the filter matches, or if there is no filter.
          $ref: "#/components/schemas/PolicyNotificationsFilter"
        callbackUri:
          description: >
            The URI of the endpoint to send the notification to.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Uri"
        authentication:
          description: >
            Authentication parameters to configure the use of Authorization when sending notifications 
            corresponding to this subscription, as defined in clause 8.3.4 of ETSI GS NFV-SOL 013.
            This attribute shall only be present if the subscriber requires authorization of notifications.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/SubscriptionAuthentication"
      required:
        - callbackUri
        This type represents a subscription related to notifications about policy changes and policy conflicts. 
        It shall comply with the provisions defined in table 5.6.2.6-1.
            Identifier of this subscription resource.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
        filter:
            Filter settings for this subscription, to define the subset of all notifications this subscription 
            relates to. A particular notification is sent to the subscriber if the filter matches, or if there 
            is no filter.
          $ref: "#/components/schemas/PolicyNotificationsFilter"
        callbackUri:
            The URI of the endpoint to send the notification to.
          $ref: "../components/SOL012_schemas.yaml#/components/schemas/Uri"
        _links:
          description: >
            Links for this resource.
          type: object
          properties:
            self:
              description: >
                URI of this resource.
              $ref: "../components/SOL012_schemas.yaml#/components/schemas/Link"
          required:
            - self  
      required:
        - id
        - callbackUri
        - _links

    PolicyNotificationsFilter:
      description: >
        This type represents a subscription filter related to notifications about policy changes and policy conflicts. 
        It shall comply with the provisions defined in table 5.6.3.2-1.
        At a particular nesting level in the filter structure, the following applies: All attributes shall match in 
        order for the filter to match (logical "and" between different filter attributes). If an attribute is an array, 
        the attribute shall match if at least one of the values in the array matches (logical "or" between the values 
        of one filter attribute).
      type: object
      properties:
        notificationTypes:
          description: >
            Match particular notification types.
            Permitted values:
            -	PolicyChangeNotification
            -	PolicyConflictNotification
            The permitted values of the "notificationTypes" attribute are spelled exactly as the names of the notification 
            types to facilitate automated code generation systems.
          type: array
          items:
            type: string
            enum:
              - PolicyChangeNotification
              - PolicyConflictNotification
        policyIds:
          description: >
            Match particular policy identifiers.
            For "PolicyConflictNotification", the notification is sent if any of the policies specified in the subscription 
            is impacted by the conflict, as defined in clause 5.6.2.8.
          type: array
          items:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/Identifier"
        changeTypes:
          description: >
            Match particular policy management operation types that cause the change of the policy.
          type: array
          items:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/PolicyOperationType"
    Policy.Post.201:
      description: >
        201 Created

        Shall be returned when a policy has been created successfully.
        The response body shall contain a representation of the individual policy, as defined in clause 5.6.2.3.
        The HTTP response shall include a "Location" HTTP header that contains the resource URI of the created policy.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Location:
          description: >
            The resource URI of the created resource.
          schema:
            type: string
            format: url
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Policy"

    Policy.Get.200:
      description: >
        Shall be returned when information about zero or more policies has been queried successfully.
        The response body shall contain in an array the representations of zero or more policies, as defined
        in clause 5.6.2.3.
        If the "filter" URI parameter was supplied in the request and is supported, the data in the response body
        shall have been transformed according to the rules specified in clauses 5.2.2 and 5.3.2 of
        ETSI GS NFV-SOL 013 [6], respectively.
        If the API producer supports alternative 2 (paging) according to clause 5.4.2.1 of ETSI GS NFV-SOL 013 [6]
        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 [6].
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Link:
          description: >
            Reference to other resources. Link HTTP header in this response
            shall follow the provisions in clause 5.4.2.3 of ETSI GS NFV-SOL 013.
          schema:
            type: string
            minimum: 0
            maximum: 1
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: "#/components/schemas/Policy"

    Policy.Get.400:
      description: >
        Shall be returned upon the following error: Invalid attribute-based filtering expression.
        The response body shall contain a ProblemDetails structure, in which the "detail" attribute
        should convey more information about the error.

        Shall be returned upon the following error: Response too big.
        If the API producer supports alternative 1 (error) according to clause 5.4.2.1 of ETSI GS NFV-SOL 013 [6]
        for this resource, this error response shall follow the provisions in clause 5.4.2.2 of ETSI GS NFV-SOL 013 [6].
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"

    IndividualPolicy.Get.200:
      description: >
        Shall be returned when information about an individual policy has been read successfully.
        The response body shall contain a representation of the policy, as defined in clause 5.6.2.3.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Policy"

    PolicyModifications.Patch.200:
      description: >
        200 OK

        Shall be returned when the modifications have been processed successfully.
        The response body shall contain a representation of modifications of the policy, as defined in clause 5.6.2.4.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/PolicyModifications"
    PolicyModifications.Patch.409:
      description: >
        409 Conflict

        Shall be returned upon the following error: The operation cannot be executed currently, due to a conflict
        with the state of the resource.
        Typical reasons are attempts to:
        •	modify a policy in CREATED state;
        •	activate a policy in ACTIVATED state;
        •	deactivate a policy in DEACTIVATED state.
        The response body shall contain a ProblemDetails structure, in which the "detail" attribute shall
        convey more information about the error.

      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"

    Policy.Delete.204:
      description: >
        204 No Content

        Shall be returned when the individual policy has been deleted successfully.
        The response body shall be empty
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
    Policy.Delete.409:
      description: >
        409 Conflict

        Shall be returned upon the following error: The operation cannot be executed currently, due to a
        conflict with the state of the resource.
        Typically, this is due to the fact that the policy is in ACTIVATED state.
        The response body shall contain a ProblemDetails structure, in which the "detail" attribute shall
        convey more information about the error.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"

    PolicySelectedVersion.Get.200:
      description: >
        200 OK
        Shall be returned when the content of the selected version of an individual policy has been read successfully.
        The response body shall include a copy of the policy content.
        The "Content-Type" HTTP header shall be set according to the type of the policy content.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Content-Type:
          description: >
            The "Content-Type" HTTP header shall be set according to the type of the policy content
          schema:
            type: string
      content:
        application/*:
          schema:
            type: object
            additionalProperties: true
    PolicySelectedVersion.Get.404:
      description: >
        404 Not Found

        Shall be returned upon the following error: The API producer did not find a current representation for the
        target resource or is not willing to disclose that one exists.
        The general cause for this error and its handling is specified in clause 6.4 of ETSI GS NFV-SOL 013 [6],
        including rules for the presence of the response body.
        Specifically in case of this resource, the response code 404 shall also be returned if the policy is in
        CREATED state.
        In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which
        the "detail" attribute shall convey more information about the error.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"

    IndividualPolicyVersion.Get.200:
      description: >
        200 OK

        Shall be returned when the content of a particular version of an individual policy has been read successfully.
        The response body shall include a copy of the policy content.
        The "Content-Type" HTTP header shall be set according to the type of the policy content.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Content-Type:
          description: >
            The "Content-Type" HTTP header shall be set according to the type of the policy content
          schema:
            type: string
      content:
        application/*:
          schema:
            type: object
            additionalProperties: true
    PolicyVersionTransfer.Put.201:
      description: >
        201 Created

        Shall be returned when the policy content has been transferred successfully.
        The response body shall be empty.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string

    PolicyVersionTransfer.Put.409:
      description: >
        409 Conflict

        Shall be returned upon the following error: The operation cannot be executed currently,
        due to a conflict with an existing resource.
        Typically, this is due to the fact that the particular version has already been transferred to the API producer.
        The response body shall contain a ProblemDetails structure, in which the "detail" attribute shall convey more
        information about the error.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"
    PolicyVersion.Delete.204:
      description: >
        204 No Content

        Shall be returned when a particular version of an individual policy has been deleted successfully.
        The response body shall be empty
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string

    PolicyVersion.Delete.409:
      description: >
        409 Conflict

        Shall be returned upon the following error: The operation cannot be executed currently, due to a
        conflict with the state of the resource.
        Typically, this is due to the fact that the requested version is the selected version.
        The response body shall contain a ProblemDetails structure, in which the "detail" attribute shall
        convey more information about the error.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"
    Subscriptions.Post.201:
      description: >
        201 Created

        Shall be returned when the subscription has been created successfully. 
        A representation of the created subscription resource shall be returned in the response body, 
        as defined in clause 5.6.2.6.
        The HTTP response shall include a "Location" HTTP header that points to the created 
        "Individual subscription" resource.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Location:
          description: >
            The resource URI of the created resource.
          schema:
            type: string
            format: url
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/PolicySubscription"

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

        Shall be returned if a subscription with the same callbackUri and the same filter already exists 
        and the policy of the API producer 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:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Location:
          description: >
            The resource URI of the created resource.
          schema:
            type: string
            format: url
        
    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 policy 
        subscriptions as defined in clause 5.6.2.6.
        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 API producer 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:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
        Link:
          description: >
            Reference to other resources. Link HTTP header in this response shall follow the provisions 
            in clause 5.4.2.3 of ETSI GS NFV-SOL 013.
          schema:
            type: string
            minimum: 0
            maximum: 1
      content:
        application/json:
          schema: 
            type: array
            items:
              $ref: "#/components/schemas/PolicySubscription"

    Subscriptions.Get.400:
      description: >
        400 Bad Request

        Shall be returned upon the following error: Invalid attribute-based filtering expression.
        The response body shall contain a ProblemDetails structure, in which the "detail" attribute 
        should convey more information about the error.

        Shall be returned upon the following error: Response too big. 
        If the API producer supports alternative 1 (error) according to clause 5.4.2.1 of ETSI GS NFV-SOL 013
        for this resource, this error response shall follow the provisions in clause 5.4.2.2 of 
        ETSI GS NFV-SOL 013.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/ProblemDetails"
        
    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 subscription resource, as defined in 
        clause 5.6.2.6.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string
      content:
        application/json:
          schema: 
            $ref: "#/components/schemas/PolicySubscription"
        
    IndividualSubscription.Delete.204:
      description: >
        204 No Content

        Shall be returned when the "individual subscription" resource has been deleted successfully.
        The response body shall be empty.
      headers:
        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.
          schema:
            type: string
        Version:
          description: >
            Version of the API used in the response.
          schema:
            type: string        

    CreatePolicyRequest:
      description: >
        This type represents request parameters for creating a policy. It shall comply with the provisions defined
        in table 5.6.2.2-1.
      content:
        application/json:
          schema:
           $ref: "#/components/schemas/CreatePolicyRequest"
      required: true

    ModifyPolicyRequest:
      description: >
        The parameter for the policy modifications, as defined in clause 5.6.2.4.
      content:
        application/json:
          schema:
            $ref: "../components/SOL012_schemas.yaml#/components/schemas/PolicyModifications"

    PolicyVersionTransferRequest:
      description: >
        The payload body contains a copy of the policy content.
        The "Content-Type" HTTP header shall be set according to the type of the policy content.
      content:
        application/*:
          schema:
            type: object
            additionalProperties: true

    PolicySubscriptionCreateRequest:
      description: >
        Details of the subscription to be created.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/PolicySubscriptionRequest"