Commit 68625d1f authored by Michele Carignani's avatar Michele Carignani

Merge branch '3.3.1-dev' into 'master'

SOL WG approved OpenAPIs for SOL012 v3.4.1

See merge request !1
parents 67c43d4c 34f8016e
Pipeline #5012 passed with stage
in 0 seconds
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
cd "$(dirname "$0")"
run_dir="$(pwd)"
rm build/*-API.yaml
rm build/*-API.json
cd docker
./build-container.sh
./run-container.sh "${run_dir}"
OUTCOME=$?
exit $OUTCOME
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
FROM alpine:3.10.0
RUN env
RUN apk update
RUN apk add bash
RUN apk add nodejs
RUN apk add nodejs-npm
RUN apk add asciidoctor
RUN apk add openjdk8
RUN apk add ca-certificates wget && update-ca-certificates
RUN apk add openssl
RUN gem install rdoc --pre || gem install rdoc --pre
RUN gem install asciidoctor-pdf-cjk
RUN wget https://forge.etsi.org/swagger2markup-cli-1.3.2.jar
RUN npm config set proxy $http_proxy
RUN npm install -g swagger-cli
RUN npm install -g json-refs
RUN npm install -g yamljs
ADD validate-in-docker.sh /validate-in-docker.sh
RUN chmod +x /validate-in-docker.sh
ADD swg2mrkup /bin/swg2mrkup
RUN chmod +x /bin/swg2mrkup
ADD oas2pdf /bin/oas2pdf
RUN chmod +x /bin/oas2pdf
ENTRYPOINT ["/validate-in-docker.sh"]
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
#set -x
proxy = ""
if [[ ! -v http_proxy ]]; then
echo "http_proxy is not set"
elif [[ -z "$http_proxy" ]]; then
echo "http_proxy is empty"
else
echo "http_proxy is set to $http_proxy"
if [[ $http_proxy =~ ^http:\/\/[0-9] ]]; then
echo "starts with http"
proxy=$http_proxy
elif [[ $http_proxy =~ ^[0-9] ]]; then
echo "starts with number"
proxy=http://$http_proxy
fi
fi
echo "Proxy set to $proxy"
docker build --build-arg http_proxy=$proxy --build-arg https_proxy=$proxy -t openapivalidator .
\ No newline at end of file
#!/bin/bash
#Copyright (c) ETSI 2017.
# This software is subject to copyrights owned by ETSI. Non-exclusive permission
# is hereby granted, free of charge, to copy, reproduce and amend this file
# under the following conditions: It is provided "as is", without warranty of any
# kind, expressed or implied.
# ETSI shall never be liable for any claim, damages, or other liability arising
# from its use or inability of use.This permission does not apply to any documentation
# associated with this file for which ETSI keeps all rights reserved. The present
# copyright notice shall be included in all copies of whole or part of this
# software and shall not imply any sub-license right.
#
# Author: michele.carignani@etsi.org
#
# This script takes an OpenAPI file in input and creates
# a PDF file with the content.
#
# Prerequisites:
# - https://github.com/Swagger2Markup/swagger2markup-cli
# - Asciidoctor (sudo apt-get install asciidoctor)
# - Asciidoctor-pdf (sudo gem install asciidoctor-pdf)
#
# Usage:
# oas2pdf <oasfile> (e.g. myapi.json)
#
# Result:
# A new pdf file is created in the working directory (e.g. myapi.pdf)
#
#
#
#
# Configuration
# Change this if needed
SWG2MRKUP=swg2mrkup
ASCIIDOCPDF=asciidoctor-pdf
# Setup
WD=$(pwd)
TWD=$(mktemp -d)
INFILE=$(basename ${1?"Error: missing input file name"} )
OUTFILE="${INFILE%.*}"
echo "$INFILE, $OUTFILE"
echo "Converting to asciidoc.."
${SWG2MRKUP} convert -i "$1" -f "$TWD/$OUTFILE"
echo
echo "Converting to PDF.."
"${ASCIIDOCPDF}" "$TWD/${OUTFILE}.adoc" -o "$WD/${OUTFILE}.pdf"
echo
echo "Done."
# Clean up
rm -r $TWD
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
# Change this variable to true if you want
# to copy the created yaml files to a web served directory
#
#
WEB_PUBLISH=true
f="${1:-`pwd`}"
filter="$2"
echo "Mounting dir $f as /work"
if [ -n "$JOB_BASE_NAME" -a "$WEB_PUBLISH" = true ] ; then
s="/var/www/html/api/nfv/$JOB_BASE_NAME/$BUILD_NUMBER"
mkdir -v -p "$s"
echo "Mounting dir $s as /storage"
docker run -v "$f":/work -v "$s":/storage openapivalidator "/work" "/storage" "$filter"
else
docker run -v "$f":/work openapivalidator "/work" "/storage" "$filter"
fi
#!/bin/bash
#Copyright (c) ETSI 2017.
# This software is subject to copyrights owned by ETSI. Non-exclusive permission
# is hereby granted, free of charge, to copy, reproduce and amend this file
# under the following conditions: It is provided "as is", without warranty of any
# kind, expressed or implied.
# ETSI shall never be liable for any claim, damages, or other liability arising
# from its use or inability of use.This permission does not apply to any documentation
# associated with this file for which ETSI keeps all rights reserved. The present
# copyright notice shall be included in all copies of whole or part of this
# software and shall not imply any sub-license right.
#
# Author: michele.carignani@etsi.org
java -jar /swagger2markup-cli-1.3.2.jar $@
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt
# Merges OpenAPIs interfaces in the working directory
# and validates them individually.
# Exit status is 0 if all validation passed, 1 otherwise
# Usage:
# $0 <working-directory> <storage-dir>
#set -x
function store_api () {
f="$1"
cp -v "$1" "${storage_dir}/"
}
function validate_api () {
file="$1"
api="$2"
deliverable="$3"
echo "--- Merging file."
merged_file="../build/${deliverable}-${api}-API.yaml"
json_file="../build/${deliverable}-${api}-API.json"
json-refs resolve "${file}" > "${merged_file}"
yaml2json "${merged_file}" > "${json_file}"
# Create the PDF version
echo "--- Create PDF..."
oas2pdf "${json_file}" 2>/dev/null 1>/dev/null
mv "${deliverable}-${api}-API.pdf" "../build/"
echo "--- Validating ${merged_file}"
swagger-cli validate "${merged_file}"
vres=$?
echo "--- Validation done ($vres)."
# If validation succedes, store the generated file
[ $vres -a -d "/storage" ] && store_api "${merged_file}"
[ $vres -a -d "/storage" ] && store_api "${json_file}"
[ $vres -a -d "/storage" ] && store_api "../build/${deliverable}-${api}-API.pdf"
return $vres
}
# usage get_api_from_fn <file_name>
# e.g. get_api_from_fn /path/to/SOL003/Api1/Api1.yaml returns Api1
function get_api_from_fn () {
echo "$(basename $(dirname $1))"
}
# usage get_api_from_fn <file_name>
# e.g. get_api_from_fn /path/to/SOL003/Api1/Api1.yaml returns Api1
function get_deliverable_from_fn () {
echo "$(basename $(dirname $(dirname $1 )))"
}
## Main ##
wd="${1?"Usage: $0 <working-directory> <storage-directory> [<filter_regex>]"}"
storage_dir="${2?"Usage: $0 <working-directory> <storage-directory> [<filter_regex>]"}"
filter="$3"
echo "Using filter '$filter'"
echo
mkdir -p "$wd/build"
echo "Entering dir $wd/src"
cd "$wd/src"
# Stores the overall validation result
# (single results in OR)
fres=0
for f in $(find -name "*.yaml") ; do
# echo "Found yaml file: $f"
file=$(basename "$f")
api=$(get_api_from_fn $f)
deliverable=$(get_deliverable_from_fn $f)
if [ "$file" = "$api.yaml" ]; then
if [[ -n "$filter" && ! "$f" =~ ^[a-zA-Z0-9\.\/\-]*$filter[a-zA-Z\.\/0-9\-]*$ ]] ; then
echo "Filtered out: $f (api: $api) (deliverable:$deliverable)."
else
echo "-- Will validate: $f (api: $api) (deliverable:$deliverable)"
validate_api "$f" "$api" "$deliverable"
res=$?
fres=$(($fres||$res))
fi
fi
done
chmod -R o+w "$wd/build"
# Exit code needed for jenkins to know the verdict of the build
echo "-- Final validator returns $fres."
exit $fres
openapi: 3.0.2
info:
version: 1.0.0-impl:etsi.org:ETSI_NFV_OpenAPI:1
title: SOL012 - API version interface
description: >
SOL012 - API version Interface
IMPORTANT: Please note that this file might
be not aligned to the current version of the ETSI Group Specification it
refers to and has not been approved by the ETSI NFV ISG. 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
contact:
name: NFV-SOL WG
externalDocs:
description: ETSI GS NFV-SOL 012 v3.4.1
url: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/012/03.04.01_60/gs_nfv-sol012v030401p.pdf
paths:
/nfvpolicy/api_versions:
$ref: '../endpoints/SOL012_endpoints.yaml#/endpoints/api_versions'
\ No newline at end of file
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://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/012/03.04.01_60/gs_nfv-sol012v030401p.pdf
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"
responses:
"201":
$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
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'
"400":
$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/PolicyModifications"
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"
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/PolicySubscriptionRequest'
responses:
"201":
$ref: '#/components/responses/Subscriptions.Post.201'
"303":
$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