diff options
-rw-r--r-- | docs/api/api.rst | 30 | ||||
-rw-r--r-- | docs/api/swagger/nodetemplates-api.json | 1742 | ||||
-rwxr-xr-x | integration/src/release_scripts/bumpSnapshots.sh | 2 | ||||
-rwxr-xr-x | integration/src/release_scripts/generateCommit.sh | 2 | ||||
-rwxr-xr-x | integration/src/release_scripts/releasePhase.sh | 33 | ||||
-rwxr-xr-x | integration/src/release_scripts/updateRefs.sh | 47 |
6 files changed, 1835 insertions, 21 deletions
diff --git a/docs/api/api.rst b/docs/api/api.rst index 8b0ae3e8..5aa38853 100644 --- a/docs/api/api.rst +++ b/docs/api/api.rst @@ -181,6 +181,7 @@ Global API Table "Statistics API", ":download:`link <swagger/statistics-api.json>`" "Tosca Policy Type API", ":download:`link <swagger/policytype-api.json>`" "Tosca Policy API", ":download:`link <swagger/policy-api.json>`" + "Tosca NodeTemplate API", ":download:`link <swagger/nodetemplates-api.json>`" API Swagger ----------- @@ -217,6 +218,35 @@ x-onap-requestid is used to track REST transactions for logging purpose, as desc .. swaggerv2doc:: swagger/policy-api.json + +Creating MetadataSet for policy +-------------------------------- + +The policy type implementation in tosca policy can be independently persisted to the database as metadataSets via the Tosca node template Apis . +The policy type implementation data can be excluded from the policy properties section of the tosca policy and the user can specify only the "metadataSetName" and "metadataSetVersion" +fields under the policy "metadata" section to map a specific policy type implementation to the policy during the policy creation. + +The following sample tosca service template comprises a list of tosca node templates each containing a policy type implementation data in the form of metadataSet that can be persisted to the database independently using the policy node template Api. + +.. csv-table:: + :header: "Tosca node template", "Payload" + :widths: 15,10 + + "sample.nodetemplates.metadatasets", `nodetemplates.metadatasets.input.tosca.yaml <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/nodetemplates/nodetemplates.metadatasets.input.tosca.yaml>`_ `nodetemplates.metadatasets.input.tosca.json <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/nodetemplates/nodetemplates.metadatasets.input.tosca.json>`_ + + +The following sample tosca policy shows the policy metadata section that maps to one of the metadataSets stored in the database prior to the policy creation. + +.. csv-table:: + :header: "Tosca policy", "Payload" + :widths: 15,10 + + "apex.decisionmaker.policy", `apex.policy.decisionmaker.input.tosca.yaml <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policies/apex.policy.decisionmaker.input.tosca.yaml>`_ + +The following node template Apis are introduced to handle the policy metadataSets as independent entities that can be later mapped to a tosca policy during policy creation. + +.. swaggerv2doc:: swagger/nodetemplates-api.json + When making a POST policy API call, the client must not only provide well-formed JSON/YAML, but also must conform to the TOSCA specification. For example. the "type" field for a TOSCA policy should strictly match the policy type name it derives. diff --git a/docs/api/swagger/nodetemplates-api.json b/docs/api/swagger/nodetemplates-api.json new file mode 100644 index 00000000..bd8ed48e --- /dev/null +++ b/docs/api/swagger/nodetemplates-api.json @@ -0,0 +1,1742 @@ +{ + "swagger": "2.0", + "basePath": "/", + "tags": [ + { + "name": "nodeTemplate" + } + ], + "schemes": [ + "http", + "https" + ], + "paths": { + "/policy/api/v1/nodetemplates":{ + "get":{ + "tags":[ + "nodeTemplates" + ], + "summary":"Retrieve all the available tosca node templates", + "description":"Returns all the node templates from the service template", + "operationId":"getAllNodeTemplatesUsingGET", + "produces":[ + "application/json", + "application/yaml" + ], + "parameters":[ + { + "name":"X-ONAP-RequestID", + "in":"header", + "description":"RequestID for http transaction", + "required":false, + "type":"string", + "format":"uuid" + } + ], + "responses":{ + "200":{ + "description":"OK", + "schema":{ + "type":"array", + "items":{ + "$ref":"#/definitions/ToscaNodeTemplateRes", + "originalRef":"ToscaNodeTemplateRes" + } + } + }, + "401":{ + "description":"Authentication Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "403":{ + "description":"Authorization Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "404":{ + "description":"Resource Not Found", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "500":{ + "description":"Internal Server Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + } + }, + "security":[ + { + "basicAuth":[ + + ] + } + ], + "x-interface info":{ + "api-version":"1.0.0", + "last-mod-release":"Jakarta" + } + }, + "post":{ + "tags":[ + "nodeTemplate" + ], + "summary":"Create one or more new node templates", + "description":"Client should provide TOSCA body of the new node templates", + "operationId":"createToscaNodeTemplatesUsingPOST", + "consumes":[ + "application/json" + ], + "produces":[ + "application/json", + "application/yaml" + ], + "parameters":[ + { + "in":"body", + "name":"body", + "description":"Entity body of tosca node templates", + "required":true, + "schema":{ + "$ref":"#/definitions/ToscaServiceTemplateReq", + "originalRef":"ToscaServiceTemplateReq" + } + }, + { + "name":"X-ONAP-RequestID", + "in":"header", + "description":"RequestID for http transaction", + "required":false, + "type":"string", + "format":"uuid" + } + ], + "responses":{ + "200":{ + "description":"OK", + "schema":{ + "$ref":"#/definitions/ToscaServiceTemplateRes", + "originalRef":"ToscaServiceTemplateRes" + } + }, + "201":{ + "description":"Created" + }, + "400":{ + "description":"Invalid Body", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "401":{ + "description":"Authentication Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "403":{ + "description":"Authorization Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "404":{ + "description":"Resource Not Found", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "406":{ + "description":"Not Acceptable Payload", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "500":{ + "description":"Internal Server Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + } + }, + "security":[ + { + "basicAuth":[ + + ] + } + ], + "x-interface info":{ + "api-version":"1.0.0", + "last-mod-release":"Jakarta" + } + }, + "put":{ + "tags":[ + "nodeTemplate" + ], + "summary":"Updates one or more new node templates", + "description":"Client should provide TOSCA body of the updated node templates", + "operationId":"updateToscaNodeTemplatesUsingPUT", + "consumes":[ + "application/json" + ], + "produces":[ + "application/json", + "application/yaml" + ], + "parameters":[ + { + "in":"body", + "name":"body", + "description":"Entity body of tosca node templates", + "required":true, + "schema":{ + "$ref":"#/definitions/ToscaServiceTemplateReq", + "originalRef":"ToscaServiceTemplateReq" + } + }, + { + "name":"X-ONAP-RequestID", + "in":"header", + "description":"RequestID for http transaction", + "required":false, + "type":"string", + "format":"uuid" + } + ], + "responses":{ + "200":{ + "description":"OK", + "schema":{ + "$ref":"#/definitions/ToscaServiceTemplateRes", + "originalRef":"ToscaServiceTemplateRes" + } + }, + "201":{ + "description":"Created" + }, + "400":{ + "description":"Invalid Body", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "401":{ + "description":"Authentication Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "403":{ + "description":"Authorization Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "404":{ + "description":"Resource Not Found", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "406":{ + "description":"Not Acceptable Payload", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "500":{ + "description":"Internal Server Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + } + }, + "security":[ + { + "basicAuth":[ + + ] + } + ], + "x-interface info":{ + "api-version":"1.0.0", + "last-mod-release":"Jakarta" + } + } + }, + "/policy/api/v1/nodetemplates/{name}/versions/{version}":{ + "get":{ + "tags":[ + "nodeTemplates" + ], + "summary":"Retrieve one version of a tosca node template", + "description":"Returns a particular version of a node template", + "operationId":"getSpecificVersionOfNodeTemplateUsingGET", + "produces":[ + "application/json", + "application/yaml" + ], + "parameters":[ + { + "name":"name", + "in":"path", + "description":"Name of the node template", + "required":true, + "type":"string" + }, + { + "name":"version", + "in":"path", + "description":"Version of the node template", + "required":true, + "type":"string" + }, + { + "name":"X-ONAP-RequestID", + "in":"header", + "description":"RequestID for http transaction", + "required":false, + "type":"string", + "format":"uuid" + } + ], + "responses":{ + "200":{ + "description":"OK", + "schema":{ + "type":"array", + "items":{ + "$ref":"#/definitions/ToscaNodeTemplateRes", + "originalRef":"ToscaNodeTemplateRes" + } + } + }, + "401":{ + "description":"Authentication Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "403":{ + "description":"Authorization Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "404":{ + "description":"Resource Not Found", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "500":{ + "description":"Internal Server Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + } + }, + "security":[ + { + "basicAuth":[ + + ] + } + ], + "x-interface info":{ + "api-version":"1.0.0", + "last-mod-release":"Jakarta" + } + }, + "delete":{ + "tags":[ + "nodeTemplate" + ], + "summary":"Deletes a specific node templates", + "description":"Client should provide the name and version of the node template to be deleted", + "operationId":"deleteToscaNodeTemplatesUsingDELETE", + "produces":[ + "application/json", + "application/yaml" + ], + "parameters":[ + { + "name":"name", + "in":"path", + "description":"Name of the node template", + "required":true, + "type":"string" + }, + { + "name":"version", + "in":"path", + "description":"Version of the node template", + "required":true, + "type":"string" + }, + { + "name":"X-ONAP-RequestID", + "in":"header", + "description":"RequestID for http transaction", + "required":false, + "type":"string", + "format":"uuid" + } + ], + "responses":{ + "200":{ + "description":"OK", + "schema":{ + "$ref":"#/definitions/ToscaServiceTemplateRes", + "originalRef":"ToscaServiceTemplateRes" + } + }, + "204":{ + "description":"No Content" + }, + "400":{ + "description":"Invalid Body", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "401":{ + "description":"Authentication Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "403":{ + "description":"Authorization Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "404":{ + "description":"Resource Not Found", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "406":{ + "description":"Not Acceptable Payload", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + }, + "500":{ + "description":"Internal Server Error", + "headers":{ + "X-LatestVersion":{ + "type":"string" + }, + "X-PatchVersion":{ + "type":"string" + }, + "X-MinorVersion":{ + "type":"string" + }, + "X-ONAP-RequestID":{ + "type":"string", + "format":"uuid" + } + } + } + }, + "security":[ + { + "basicAuth":[ + + ] + } + ], + "x-interface info":{ + "api-version":"1.0.0", + "last-mod-release":"Jakarta" + } + } + } + }, + "definitions": { + + "ToscaCapabilityAssignmentReq":{ + "type":"object", + "properties":{ + "attributes":{ + "type":"object" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "occurrences":{ + "type":"array", + "items":{ + "type":"object" + } + }, + "properties":{ + "type":"object" + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaCapabilityAssignmentReq" + }, + "ToscaCapabilityAssignmentRes":{ + "type":"object", + "properties":{ + "attributes":{ + "type":"object" + }, + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "identifier":{ + "$ref":"#/definitions/ToscaConceptIdentifier", + "originalRef":"ToscaConceptIdentifier" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "occurrences":{ + "type":"array", + "items":{ + "type":"object" + } + }, + "properties":{ + "type":"object" + }, + "type":{ + "type":"string" + }, + "typeIdentifier":{ + "$ref":"#/definitions/ToscaConceptIdentifier", + "originalRef":"ToscaConceptIdentifier" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaCapabilityAssignmentRes" + }, + "ToscaCapabilityTypeReq":{ + "type":"object", + "properties":{ + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaCapabilityTypeReq" + }, + "ToscaCapabilityTypeRes":{ + "type":"object", + "properties":{ + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaCapabilityTypeRes" + }, + "ToscaConceptIdentifier":{ + "type":"object", + "properties":{ + "name":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaConceptIdentifier" + }, + "ToscaConstraint":{ + "type":"object", + "properties":{ + "equal":{ + "type":"string" + }, + "greaterOrEqual":{ + "type":"string" + }, + "greaterThan":{ + "type":"string" + }, + "lessOrEqual":{ + "type":"string" + }, + "lessThan":{ + "type":"string" + }, + "rangeValues":{ + "type":"array", + "items":{ + "type":"string" + } + }, + "validValues":{ + "type":"array", + "items":{ + "type":"string" + } + } + }, + "title":"ToscaConstraint" + }, + "ToscaDataTypeReq":{ + "type":"object", + "properties":{ + "constraints":{ + "type":"array", + "items":{ + "$ref":"#/definitions/ToscaConstraint", + "originalRef":"ToscaConstraint" + } + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaDataTypeReq" + }, + "ToscaDataTypeRes":{ + "type":"object", + "properties":{ + "constraints":{ + "type":"array", + "items":{ + "$ref":"#/definitions/ToscaConstraint", + "originalRef":"ToscaConstraint" + } + }, + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaDataTypeRes" + }, + "ToscaEntityKey":{ + "type":"object", + "properties":{ + "name":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaEntityKey" + }, + "ToscaNodeTemplateReq":{ + "type":"object", + "properties":{ + "capabilities":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaCapabilityAssignmentReq", + "originalRef":"ToscaCapabilityAssignmentReq" + } + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object" + }, + "requirements":{ + "type":"array", + "items":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaRequirementReq", + "originalRef":"ToscaRequirementReq" + } + } + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaNodeTemplateReq" + }, + "ToscaNodeTemplateRes":{ + "type":"object", + "properties":{ + "capabilities":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaCapabilityAssignmentRes", + "originalRef":"ToscaCapabilityAssignmentRes" + } + }, + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "identifier":{ + "$ref":"#/definitions/ToscaConceptIdentifier", + "originalRef":"ToscaConceptIdentifier" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object" + }, + "requirements":{ + "type":"array", + "items":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaRequirementRes", + "originalRef":"ToscaRequirementRes" + } + } + }, + "type":{ + "type":"string" + }, + "typeIdentifier":{ + "$ref":"#/definitions/ToscaConceptIdentifier", + "originalRef":"ToscaConceptIdentifier" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaNodeTemplateRes" + }, + "ToscaNodeTypeReq":{ + "type":"object", + "properties":{ + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "requirements":{ + "type":"array", + "items":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaRequirementReq", + "originalRef":"ToscaRequirementReq" + } + } + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaNodeTypeReq" + }, + "ToscaNodeTypeRes":{ + "type":"object", + "properties":{ + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "requirements":{ + "type":"array", + "items":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaRequirementRes", + "originalRef":"ToscaRequirementRes" + } + } + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaNodeTypeRes" + }, + "ToscaParameter":{ + "type":"object", + "properties":{ + "name":{ + "type":"string" + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "value":{ + "type":"object" + } + }, + "title":"ToscaParameter" + }, + "ToscaProperty":{ + "type":"object", + "properties":{ + "constraints":{ + "type":"array", + "items":{ + "$ref":"#/definitions/ToscaConstraint", + "originalRef":"ToscaConstraint" + } + }, + "defaultValue":{ + "type":"object" + }, + "description":{ + "type":"string" + }, + "entrySchema":{ + "$ref":"#/definitions/ToscaSchemaDefinition", + "originalRef":"ToscaSchemaDefinition" + }, + "keySchema":{ + "$ref":"#/definitions/ToscaSchemaDefinition", + "originalRef":"ToscaSchemaDefinition" + }, + "metadata":{ + "type":"object", + "additionalProperties":{ + "type":"string" + } + }, + "name":{ + "type":"string" + }, + "required":{ + "type":"boolean" + }, + "status":{ + "type":"string", + "enum":[ + "DEPRECATED", + "EXPERIMENTAL", + "SUPPORTED", + "UNSUPPORTED" + ] + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + } + }, + "title":"ToscaProperty" + }, + "ToscaRelationshipTypeReq":{ + "type":"object", + "properties":{ + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaRelationshipTypeReq" + }, + "ToscaRelationshipTypeRes":{ + "type":"object", + "properties":{ + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "properties":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaProperty", + "originalRef":"ToscaProperty" + } + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaRelationshipTypeRes" + }, + "ToscaRequirementReq":{ + "type":"object", + "properties":{ + "capability":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "node":{ + "type":"string" + }, + "occurrences":{ + "type":"array", + "items":{ + "type":"object" + } + }, + "properties":{ + "type":"object" + }, + "relationship":{ + "type":"string" + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaRequirementReq" + }, + "ToscaRequirementRes":{ + "type":"object", + "properties":{ + "capability":{ + "type":"string" + }, + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "identifier":{ + "$ref":"#/definitions/ToscaConceptIdentifier", + "originalRef":"ToscaConceptIdentifier" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "node":{ + "type":"string" + }, + "occurrences":{ + "type":"array", + "items":{ + "type":"object" + } + }, + "properties":{ + "type":"object" + }, + "relationship":{ + "type":"string" + }, + "type":{ + "type":"string" + }, + "typeIdentifier":{ + "$ref":"#/definitions/ToscaConceptIdentifier", + "originalRef":"ToscaConceptIdentifier" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaRequirementRes" + }, + "ToscaSchemaDefinition":{ + "type":"object", + "properties":{ + "constraints":{ + "type":"array", + "items":{ + "$ref":"#/definitions/ToscaConstraint", + "originalRef":"ToscaConstraint" + } + }, + "description":{ + "type":"string" + }, + "name":{ + "type":"string" + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + } + }, + "title":"ToscaSchemaDefinition" + }, + "ToscaServiceTemplateReq":{ + "type":"object", + "properties":{ + "capabilityTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaCapabilityTypeReq", + "originalRef":"ToscaCapabilityTypeReq" + } + }, + "dataTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaDataTypeReq", + "originalRef":"ToscaDataTypeReq" + } + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "nodeTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaNodeTypeReq", + "originalRef":"ToscaNodeTypeReq" + } + }, + "relationshipTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaRelationshipTypeReq", + "originalRef":"ToscaRelationshipTypeReq" + } + }, + "toscaDefinitionsVersion":{ + "type":"string" + }, + "toscaTopologyTemplate":{ + "$ref":"#/definitions/ToscaTopologyTemplateReq", + "originalRef":"ToscaTopologyTemplateReq" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaServiceTemplateReq" + }, + "ToscaServiceTemplateRes":{ + "type":"object", + "properties":{ + "capabilityTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaCapabilityTypeRes", + "originalRef":"ToscaCapabilityTypeRes" + } + }, + "dataTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaDataTypeRes", + "originalRef":"ToscaDataTypeRes" + } + }, + "dataTypesAsMap":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaDataTypeRes", + "originalRef":"ToscaDataTypeRes" + } + }, + "definedName":{ + "type":"string" + }, + "definedVersion":{ + "type":"string" + }, + "derivedFrom":{ + "type":"string" + }, + "description":{ + "type":"string" + }, + "key":{ + "$ref":"#/definitions/ToscaEntityKey", + "originalRef":"ToscaEntityKey" + }, + "metadata":{ + "type":"object" + }, + "name":{ + "type":"string" + }, + "nodeTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaNodeTypeRes", + "originalRef":"ToscaNodeTypeRes" + } + }, + "relationshipTypes":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaRelationshipTypeRes", + "originalRef":"ToscaRelationshipTypeRes" + } + }, + "toscaDefinitionsVersion":{ + "type":"string" + }, + "toscaTopologyTemplate":{ + "$ref":"#/definitions/ToscaTopologyTemplateRes", + "originalRef":"ToscaTopologyTemplateRes" + }, + "type":{ + "type":"string" + }, + "typeVersion":{ + "type":"string" + }, + "version":{ + "type":"string" + } + }, + "title":"ToscaServiceTemplateRes" + }, + "ToscaTopologyTemplateReq":{ + "type":"object", + "properties":{ + "description":{ + "type":"string" + }, + "inputs":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaParameter", + "originalRef":"ToscaParameter" + } + }, + "nodeTemplates":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaNodeTemplateReq", + "originalRef":"ToscaNodeTemplateReq" + } + } + }, + "title":"ToscaTopologyTemplateReq" + }, + "ToscaTopologyTemplateRes":{ + "type":"object", + "properties":{ + "description":{ + "type":"string" + }, + "inputs":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaParameter", + "originalRef":"ToscaParameter" + } + }, + "nodeTemplates":{ + "type":"object", + "additionalProperties":{ + "$ref":"#/definitions/ToscaNodeTemplateRes", + "originalRef":"ToscaNodeTemplateRes" + } + } + }, + "title":"ToscaTopologyTemplateRes" + } + } +} diff --git a/integration/src/release_scripts/bumpSnapshots.sh b/integration/src/release_scripts/bumpSnapshots.sh index d7d22df7..c67e81ff 100755 --- a/integration/src/release_scripts/bumpSnapshots.sh +++ b/integration/src/release_scripts/bumpSnapshots.sh @@ -178,7 +178,7 @@ do mv "$temp_file" "$repo_location/$repo/version.properties" fi - updateRefs.sh -pcmos -d "$release_data_file" -l "$repo_location" -r "$repo" + updateRefs.sh -pcmoxs -d "$release_data_file" -l "$repo_location" -r "$repo" if [ "$(git -C "$repo_location/$specified_repo" status | grep '^[ \t]*modified:[ \t]*pom.xml' > /dev/null 2>&1)" = 0 ] then diff --git a/integration/src/release_scripts/generateCommit.sh b/integration/src/release_scripts/generateCommit.sh index 29e600a2..a62cf493 100755 --- a/integration/src/release_scripts/generateCommit.sh +++ b/integration/src/release_scripts/generateCommit.sh @@ -20,8 +20,6 @@ # ============LICENSE_END================================================== # -set -e - SCRIPT_NAME=$(basename "$0") repo_location="./" diff --git a/integration/src/release_scripts/releasePhase.sh b/integration/src/release_scripts/releasePhase.sh index b3f7e0af..920998db 100755 --- a/integration/src/release_scripts/releasePhase.sh +++ b/integration/src/release_scripts/releasePhase.sh @@ -247,11 +247,6 @@ release_phase_7() { -pcmk \ -d "$release_data_file" \ -l "$repo_location" \ - -r "policy/gui" - updateRefs.sh \ - -pcmk \ - -d "$release_data_file" \ - -l "$repo_location" \ -r "policy/pap" updateRefs.sh \ -pcmk \ @@ -290,12 +285,6 @@ release_phase_7() { -m "updated references in the policy/drools-pdp pom" generateCommit.sh \ -l "$repo_location" \ - -r "policy/gui" \ - -i "$issue_id" \ - -e "update references in policy/gui pom" \ - -m "updated references in the policy/gui pom" - generateCommit.sh \ - -l "$repo_location" \ -r "policy/pap" \ -i "$issue_id" \ -e "update references in policy/pap pom" \ @@ -316,7 +305,6 @@ release_phase_8() { releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/clamp -i "$issue_id" releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/distribution -i "$issue_id" releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-pdp -i "$issue_id" - releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id" releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/pap -i "$issue_id" releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/xacml-pdp -i "$issue_id" echo "Generated artifact release yaml file and commit for repos" @@ -329,14 +317,13 @@ release_phase_9() { releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/clamp -i "$issue_id" releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/distribution -i "$issue_id" releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-pdp -i "$issue_id" - releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id" releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/pap -i "$issue_id" releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/xacml-pdp -i "$issue_id" echo "Generated docker release yaml file and commit for repos" } release_phase_10() { - echo "Updating snapshots for repos, updating references on policy/drools-applications . . ." + echo "Updating snapshots for repos, updating references on policy/drools-applications, policy/gui . . ." bumpSnapshots.sh \ -d "$release_data_file" \ -l "$repo_location" \ @@ -346,33 +333,47 @@ release_phase_10() { -d "$release_data_file" \ -l "$repo_location" \ -r "policy/drools-applications" + updateRefs.sh \ + -pcmxk \ + -d "$release_data_file" \ + -l "$repo_location" \ + -r "policy/gui" generateCommit.sh \ -l "$repo_location" \ -r "policy/drools-applications" \ -i "$issue_id" \ -e "update references in policy/drools-applications pom" \ -m "updated references in the policy/drools-applications pom" - echo "Updated snapshots for repos, updated references on policy/drools-applications" + generateCommit.sh \ + -l "$repo_location" \ + -r "policy/gui" \ + -i "$issue_id" \ + -e "update references in policy/gui pom" \ + -m "updated references in the policy/gui pom" + echo "Updated snapshots for repos, updated references on policy/drools-applications, policy/gui" } release_phase_11() { echo "Generating artifact release yaml file and commit for policy/drools-applications . . ." releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-applications -i "$issue_id" + releaseRepo.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id" echo "Generated artifact release yaml file and commit for policy/drools-applications" } release_phase_12() { echo "Generating docker release yaml file and commit for policy/drools-applications . . ." releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/drools-applications -i "$issue_id" + releaseRepoImages.sh -d "$release_data_file" -l "$repo_location" -r policy/gui -i "$issue_id" echo "Generated docker release yaml file and commit for policy/drools-applications" } release_phase_13() { - echo "Updating snapshots on policy/drools-applications . . ." + echo "Updating snapshots on policy/drools-applications, policy/gui . . ." bumpSnapshots.sh \ -d "$release_data_file" \ -l "$repo_location" \ -i "$issue_id" + echo "Updated snapshots on policy/drools-applications, policy/gui" } case "$release_phase" in diff --git a/integration/src/release_scripts/updateRefs.sh b/integration/src/release_scripts/updateRefs.sh index 01ea31a0..0f253f97 100755 --- a/integration/src/release_scripts/updateRefs.sh +++ b/integration/src/release_scripts/updateRefs.sh @@ -52,6 +52,7 @@ usage() echo " -c - update policy/common references" echo " -m - update policy/model references" echo " -o - update policy/drools-pdp references" + echo " -x - update policy/apex-pdp references" echo " -k - update docker base images in Dockerfiles" echo " -s - update release references to snapshot references," echo " if omitted, snapshot references are updated to release references" @@ -71,10 +72,11 @@ update_parent=false update_common=false update_models=false update_drools_pdp=false +update_apex_pdp=false update_snapshot=false update_docker=false -while getopts "hd:l:r:pcmoks" opt +while getopts "hd:l:r:pcmoxks" opt do case $opt in h) @@ -101,6 +103,9 @@ do o) update_drools_pdp=true ;; + x) + update_apex_pdp=true + ;; k) update_docker=true ;; @@ -197,6 +202,15 @@ read -r drools_pdp_repo \ # shellcheck disable=SC2034 # shellcheck disable=SC2046 +read -r apex_pdp_repo \ + apex_pdp_latest_released_tag \ + apex_pdp_latest_snapshot_tag \ + apex_pdp_changed_files \ + apex_pdp_docker_images \ + <<< $(grep policy/apex-pdp "$release_data_file" | tr ',' ' ' ) + +# shellcheck disable=SC2034 +# shellcheck disable=SC2046 read -r target_repo \ target_latest_released_tag \ target_latest_snapshot_tag \ @@ -353,12 +367,41 @@ then fi fi +if [ "$update_apex_pdp" = true ] +then + if [ "$update_snapshot" = true ] + then + echo "updating policy apex-pdp reference to $apex_pdp_latest_snapshot_tag on $repo_location/$target_repo . . ." + $SED -i \ + -e "s/<policy.apex-pdp.version>.*<\/policy.apex-pdp.version>/<policy.apex-pdp.version>$apex_pdp_latest_snapshot_tag<\/policy.apex-pdp.version>/" \ + -e "s/<version.policy.apex-pdp>.*<\/version.policy.apex-pdp>/<version.policy.apex-pdp>$apex_pdp_latest_snapshot_tag<\/version.policy.apex-pdp>/" \ + "$repo_location/$target_repo/pom.xml" + result_code=$? + else + echo "updating policy apex-pdp reference to $apex_pdp_latest_released_tag on $repo_location/$target_repo . . ." + $SED -i \ + -e "s/<policy.apex-pdp.version>.*<\/policy.apex-pdp.version>/<policy.apex-pdp.version>$apex_pdp_latest_released_tag<\/policy.apex-pdp.version>/" \ + -e "s/<version.policy.apex-pdp>.*<\/version.policy.apex-pdp>/<version.policy.apex-pdp>$apex_pdp_latest_released_tag<\/version.policy.apex-pdp>/" \ + "$repo_location/$target_repo/pom.xml" + result_code=$? + fi + if [[ "$result_code" -eq 0 ]] + then + echo "policy apex-pdp reference updated on $repo_location/$target_repo" + else + echo "policy apex-pdp reference update failed on $repo_location/$target_repo" + exit 1 + fi +fi + if [ "$update_docker" = true ] && [ "$target_docker_images" != "" ] then echo "updating docker base images to version $docker_latest_released_tag on repo $repo_location/$target_repo . . ." find "$repo_location/$target_repo" \ + -name '*Docker*' + find "$repo_location/$target_repo" \ -name '*Docker*' \ - -exec $SED -r -i "s/^(FROM onap\/policy-j[d|r][k|e]-alpine:)2.3.1$/\1$docker_latest_released_tag/" {} \; + -exec $SED -r -i "s/^(FROM onap\/policy-j[d|r][k|e]-alpine:)[0-9]*.[0-9]*.[0-9]*$/\1$docker_latest_released_tag/" {} \; result_code=$? if [[ "$result_code" -eq 0 ]] then |