From 49ab84a916e96fde4fc39258fa10f8b5ce775f48 Mon Sep 17 00:00:00 2001 From: sebdet Date: Fri, 13 Mar 2020 15:27:41 -0700 Subject: Fix the legacy policies Fix the legacy policies not displayed in the UI properly due to the new PolicyModal dialog. Issue-ID: CLAMP-779 Signed-off-by: sebdet Change-Id: I8070d8c57e43c9a386e09475f0d377f91104aef1 --- .../policy/operational/OperationalPolicy.java | 3 +- .../OperationalPolicyRepresentationBuilder.java | 6 +- src/main/resources/META-INF/resources/swagger.html | 110 +- .../operational_policies/operational_policy.json | 921 ++++++------ .../1.0.0?connectionTimeToLive=5000/.file | 8 +- .../1.0.0?connectionTimeToLive=5000/.file | 8 +- .../tosca/operational-policy-json-schema.json | 1490 ++++++++++---------- 7 files changed, 1254 insertions(+), 1292 deletions(-) (limited to 'src') diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java index 355a889e0..528d695c3 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -152,6 +152,7 @@ public class OperationalPolicy extends Policy implements Serializable { /** * This method can generate a Json representation (json schema) for an operational policy. * This is mainly to support a legacy case and a generic case. + * For the legacy case the operational policy given is modified (configurationJson). * * @param operationalPolicy The operational policy * @param toscaConverter The tosca converter @@ -166,7 +167,7 @@ public class OperationalPolicy extends Policy implements Serializable { } if (operationalPolicy.isLegacy()) { // Op policy Legacy case - LegacyOperationalPolicy.preloadConfiguration(jsonReturned, operationalPolicy.loop); + LegacyOperationalPolicy.preloadConfiguration(operationalPolicy.getConfigurationsJson(), operationalPolicy.loop); jsonReturned = OperationalPolicyRepresentationBuilder .generateOperationalPolicySchema(operationalPolicy.loop.getModelService()); } diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java index 0298cfde7..c88c1b984 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicyRepresentationBuilder.java @@ -52,15 +52,13 @@ public class OperationalPolicyRepresentationBuilder { JsonObject jsonSchema = JsonUtils.GSON.fromJson( ResourceFileUtil.getResourceAsString("clds/json-schema/operational_policies/operational_policy.json"), JsonObject.class); - jsonSchema.get("schema").getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject() - .get("configurationsJson").getAsJsonObject().get("properties").getAsJsonObject() + jsonSchema.get("properties").getAsJsonObject() .get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies") .getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("target") .getAsJsonObject().get("anyOf").getAsJsonArray().addAll(createAnyOfArray(modelJson)); // update CDS recipe and payload information to schema - JsonArray actors = jsonSchema.get("schema").getAsJsonObject().get("items").getAsJsonObject().get("properties") - .getAsJsonObject().get("configurationsJson").getAsJsonObject().get("properties").getAsJsonObject() + JsonArray actors = jsonSchema.get("properties").getAsJsonObject() .get("operational_policy").getAsJsonObject().get("properties").getAsJsonObject().get("policies") .getAsJsonObject().get("items").getAsJsonObject().get("properties").getAsJsonObject().get("actor") .getAsJsonObject().get("anyOf").getAsJsonArray(); diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html index 0451f1e0d..61b9d26c0 100644 --- a/src/main/resources/META-INF/resources/swagger.html +++ b/src/main/resources/META-INF/resources/swagger.html @@ -444,31 +444,31 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • 2. Paths
      -
    • 2.1. GET /v1/healthcheck +
    • 2.1. GET /v1/healthcheck
    • -
    • 2.2. GET /v1/user/getUser +
    • 2.2. GET /v1/user/getUser
    • -
    • 2.3. GET /v2/clampInformation +
    • 2.3. GET /v2/clampInformation
    • -
    • 2.4. GET /v2/dictionary +
    • 2.4. GET /v2/dictionary
    • -
    • 2.5. PUT /v2/dictionary +
    • 2.5. PUT /v2/dictionary
    • -
    • 2.9. DELETE /v2/dictionary/{name} +
    • 2.9. DELETE /v2/dictionary/{name}
    • -
    • 2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion} +
    • 2.11. PUT /v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}
    • -
    • 2.12. POST /v2/loop/create/{loopName}?templateName={templateName} +
    • 2.12. POST /v2/loop/create/{loopName}?templateName={templateName}
    • -
    • 2.13. PUT /v2/loop/delete/{loopName} +
    • 2.13. PUT /v2/loop/delete/{loopName}
    • -
    • 2.14. PUT /v2/loop/deploy/{loopName} +
    • 2.14. PUT /v2/loop/deploy/{loopName}
    • -
    • 2.15. GET /v2/loop/getAllNames +
    • 2.15. GET /v2/loop/getAllNames
    • -
    • 2.16. GET /v2/loop/getstatus/{loopName} +
    • 2.16. GET /v2/loop/getstatus/{loopName}
    • -
    • 2.17. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName} +
    • 2.17. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}
    • -
    • 2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion} +
    • 2.18. PUT /v2/loop/removeOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}
    • -
    • 2.19. PUT /v2/loop/restart/{loopName} +
    • 2.19. PUT /v2/loop/restart/{loopName}
    • -
    • 2.20. PUT /v2/loop/stop/{loopName} +
    • 2.20. PUT /v2/loop/stop/{loopName}
    • -
    • 2.21. PUT /v2/loop/submit/{loopName} +
    • 2.21. PUT /v2/loop/submit/{loopName}
    • -
    • 2.22. GET /v2/loop/svgRepresentation/{loopName} +
    • 2.22. GET /v2/loop/svgRepresentation/{loopName}
    • -
    • 2.23. PUT /v2/loop/undeploy/{loopName} +
    • 2.23. PUT /v2/loop/undeploy/{loopName}
    • -
    • 2.24. POST /v2/loop/updateGlobalProperties/{loopName} +
    • 2.24. POST /v2/loop/updateGlobalProperties/{loopName}
    • -
    • 2.25. POST /v2/loop/updateMicroservicePolicy/{loopName} +
    • 2.25. POST /v2/loop/updateMicroservicePolicy/{loopName}
    • -
    • 2.26. POST /v2/loop/updateOperationalPolicies/{loopName} +
    • 2.26. POST /v2/loop/updateOperationalPolicies/{loopName}
    • -
    • 2.27. GET /v2/loop/{loopName} +
    • 2.27. GET /v2/loop/{loopName}
    • -
    • 2.28. POST /v2/policyToscaModels +
    • 2.28. POST /v2/policyToscaModels
    • -
    • 2.29. GET /v2/policyToscaModels +
    • 2.29. GET /v2/policyToscaModels
    • -
    • 2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion} +
    • 2.32. PUT /v2/policyToscaModels/{policyModelType}/{policyModelVersion}
    • -
    • 2.33. GET /v2/templates +
    • 2.33. GET /v2/templates
      • 2.33.1. Responses
      • 2.33.2. Produces
      • @@ -736,7 +736,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

        1.2. URI scheme

        -

        Host : localhost:41607
        +

        Host : localhost:46291
        BasePath : /restservices/clds/
        Schemes : HTTP

        @@ -747,7 +747,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

        2. Paths

        -

        2.1. GET /v1/healthcheck

        +

        2.1. GET /v1/healthcheck

        2.1.1. Responses

        @@ -784,7 +784,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -818,7 +818,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -855,7 +855,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -892,7 +892,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1141,7 +1141,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1265,7 +1265,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1339,7 +1339,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1411,7 +1411,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1460,7 +1460,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1522,7 +1522,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1559,7 +1559,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1621,7 +1621,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1683,7 +1683,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1757,7 +1757,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1819,7 +1819,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1881,7 +1881,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1943,7 +1943,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2005,7 +2005,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2067,7 +2067,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2145,7 +2145,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2223,7 +2223,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2301,7 +2301,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2363,7 +2363,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2435,7 +2435,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2608,7 +2608,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2692,7 +2692,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        diff --git a/src/main/resources/clds/json-schema/operational_policies/operational_policy.json b/src/main/resources/clds/json-schema/operational_policies/operational_policy.json index ef22e815d..49d7878a8 100644 --- a/src/main/resources/clds/json-schema/operational_policies/operational_policy.json +++ b/src/main/resources/clds/json-schema/operational_policies/operational_policy.json @@ -1,483 +1,464 @@ { - "schema": { - "uniqueItems": "true", - "format": "tabs", - "type": "array", - "minItems": 1, - "maxItems": 1, - "title": "Operational policies", - "items": { + "type": "object", + "title": "Configuration", + "required": [ + "operational_policy", + "guard_policies" + ], + "properties": { + "operational_policy": { + "type": "object", + "title": "Related Parameters", + "required": [ + "controlLoop", + "policies" + ], + "properties": { + "controlLoop": { + "type": "object", + "title": "Control Loop details", + "required": [ + "timeout", + "abatement", + "trigger_policy", + "controlLoopName" + ], + "properties": { + "timeout": { + "type": "string", + "title": "Overall Time Limit", + "default": "0", + "format": "number" + }, + "abatement": { + "type": "string", + "title": "Abatement", + "enum": [ + "True", + "False" + ] + }, + "trigger_policy": { + "type": "string", + "title": "Policy Decision Entry" + }, + "controlLoopName": { + "type": "string", + "title": "Control loop name", + "readOnly": "True" + } + } + }, + "policies": { + "uniqueItems": "true", + "id": "policies_array", + "type": "array", + "title": "Policy Decision Tree", + "format": "tabs-top", + "items": { + "title": "Policy Decision", "type": "object", - "title": "Operational Policy Item", - "id": "operational_policy_item", - "headerTemplate": "{{self.name}}", + "id": "policy_item", + "headerTemplate": "{{self.id}} - {{self.recipe}}", + "format": "categories", + "basicCategoryTitle": "recipe", "required": [ - "name", - "configurationsJson" + "id", + "retry", + "timeout", + "actor", + "success", + "failure", + "failure_timeout", + "failure_retries", + "failure_exception", + "failure_guard", + "target" ], "properties": { - "name": { - "type": "string", - "title": "Operational policy name", - "readOnly": "True" - }, - "configurationsJson": { - "type": "object", - "title": "Configuration", - "required": [ - "operational_policy", - "guard_policies" - ], + "id": { + "default": "Policy 1", + "title": "Policy ID", + "type": "string" + }, + "retry": { + "default": "0", + "title": "Number of Retry", + "type": "string", + "format": "number" + }, + "timeout": { + "default": "0", + "title": "Timeout", + "type": "string", + "format": "number" + }, + "actor": { + "type": "object", + "title": "Actor", + "anyOf": [ + { + "title": "APPC", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "APPC", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "default": "", + "enum": [ + "Restart", + "Rebuild", + "Migrate", + "Health-Check", + "ModifyConfig" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "SO", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "SO", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "default": "", + "enum": [ + "VF Module Create", + "VF Module Delete" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "SDNC", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "SDNC", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "default": "", + "enum": [ + "Reroute", + "BandwidthOnDemand" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "VFC", "properties": { - "operational_policy": { - "type": "object", - "title": "Related Parameters", - "required": [ - "controlLoop", - "policies" - ], + "actor": { + "title": "actor", + "type": "string", + "default": "VFC", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "required": [ + "payload" + ], + "default": "", + "enum": [ + "ModifyConfig" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "CDS", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "CDS", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "object", + "required": [ + "payload" + ], + "anyOf": [ + { + "title": "user-defined", "properties": { - "controlLoop": { - "type": "object", - "title": "Control Loop details", - "required": [ - "timeout", - "abatement", - "trigger_policy", - "controlLoopName" - ], - "properties": { - "timeout": { - "type": "string", - "title": "Overall Time Limit", - "default": "0", - "format": "number" - }, - "abatement": { - "type": "string", - "title": "Abatement", - "enum": [ - "True", - "False" - ] - }, - "trigger_policy": { - "type": "string", - "title": "Policy Decision Entry" - }, - "controlLoopName": { - "type": "string", - "title": "Control loop name", - "readOnly": "True" - } - } - }, - "policies": { - "uniqueItems": "true", - "id": "policies_array", - "type": "array", - "title": "Policy Decision Tree", - "format": "tabs-top", - "items": { - "title": "Policy Decision", - "type": "object", - "id": "policy_item", - "headerTemplate": "{{self.id}} - {{self.recipe}}", - "format": "categories", - "basicCategoryTitle": "recipe", - "required": [ - "id", - "retry", - "timeout", - "actor", - "success", - "failure", - "failure_timeout", - "failure_retries", - "failure_exception", - "failure_guard", - "target" - ], - "properties": { - "id": { - "default": "Policy 1", - "title": "Policy ID", - "type": "string" - }, - "retry": { - "default": "0", - "title": "Number of Retry", - "type": "string", - "format": "number" - }, - "timeout": { - "default": "0", - "title": "Timeout", - "type": "string", - "format": "number" - }, - "actor": { - "type": "object", - "title": "Actor", - "anyOf": [ - { - "title": "APPC", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "APPC", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "default": "", - "enum": [ - "Restart", - "Rebuild", - "Migrate", - "Health-Check", - "ModifyConfig" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "SO", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "SO", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "default": "", - "enum": [ - "VF Module Create", - "VF Module Delete" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "SDNC", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "SDNC", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "default": "", - "enum": [ - "Reroute", - "BandwidthOnDemand" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "VFC", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "VFC", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "required": [ - "payload" - ], - "default": "", - "enum": [ - "ModifyConfig" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "CDS", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "CDS", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "object", - "required": [ - "payload" - ], - "anyOf": [ - { - "title": "user-defined", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default" : "", - "format" : "textarea" - } - } - } - ] - } - } - } - ] - }, - "success": { - "default": "final_success", - "title": "When Success", - "type": "string" - }, - "failure": { - "default": "final_failure", - "title": "When Failure", - "type": "string" - }, - "failure_timeout": { - "default": "final_failure_timeout", - "title": "When Failure Timeout", - "type": "string" - }, - "failure_retries": { - "default": "final_failure_retries", - "title": "When Failure Retries", - "type": "string" - }, - "failure_exception": { - "default": "final_failure_exception", - "title": "When Failure Exception", - "type": "string" - }, - "failure_guard": { - "default": "final_failure_guard", - "title": "When Failure Guard", - "type": "string" - }, - "target": { - "type": "object", - "required": [ - "type", - "resourceID" - ], - "anyOf": [ - { - "title": "User Defined", - "additionalProperties": "True", - "properties": { - "type": { - "title": "Target type", - "type": "string", - "default": "", - "enum": [ - "VNF", - "VFMODULE", - "VM" - ] - }, - "resourceID": { - "title": "Target type", - "type": "string", - "default": "" - } - } - } - ] - } - } - } - } + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "", + "format": "textarea" + } } - }, - "guard_policies": { - "type": "array", - "format": "tabs-top", - "title": "Associated Guard policies", - "items": { - "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}", - "anyOf": [ - { - "title": "Guard MinMax", - "type": "object", - "properties": { - "policy-id": { - "type": "string", - "default": "guard.minmax.new", - "pattern": "^(guard.minmax\\..*)$" - }, - "content": { - "properties": { - "actor": { - "type": "string", - "enum": [ - "APPC", - "SO", - "VFC", - "SDNC", - "SDNR" - ] - }, - "recipe": { - "type": "string", - "enum": [ - "Restart", - "Rebuild", - "Migrate", - "Health-Check", - "ModifyConfig", - "VF Module Create", - "VF Module Delete", - "Reroute" - ] - }, - "targets": { - "type": "string", - "default": ".*" - }, - "clname": { - "type": "string", - "template": "{{loopName}}", - "watch": { - "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName" - } - }, - "guardActiveStart": { - "type": "string", - "default": "00:00:00Z" - }, - "guardActiveEnd": { - "type": "string", - "default": "10:00:00Z" - }, - "min": { - "type": "string", - "default": "0" - }, - "max": { - "type": "string", - "default": "1" - } - } - } - } - }, - { - "title": "Guard Frequency", - "type": "object", - "properties": { - "policy-id": { - "type": "string", - "default": "guard.frequency.new", - "pattern": "^(guard.frequency\\..*)$" - }, - "content": { - "properties": { - "actor": { - "type": "string", - "enum": [ - "APPC", - "SO", - "VFC", - "SDNC", - "SDNR" - ] - }, - "recipe": { - "type": "string", - "enum": [ - "Restart", - "Rebuild", - "Migrate", - "Health-Check", - "ModifyConfig", - "VF Module Create", - "VF Module Delete", - "Reroute" - ] - }, - "targets": { - "type": "string", - "default": ".*" - }, - "clname": { - "type": "string", - "template": "{{loopName}}", - "watch": { - "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName" - } - }, - "guardActiveStart": { - "type": "string", - "default": "00:00:00Z" - }, - "guardActiveEnd": { - "type": "string", - "default": "10:00:00Z" - }, - "limit": { - "type": "string" - }, - "timeWindow": { - "type": "string" - }, - "timeUnits": { - "type": "string", - "enum":["minute","hour","day","week","month","year"] - } - } - } - } - } - ] - } - } + } + ] + } } - } + } + ] + }, + "success": { + "default": "final_success", + "title": "When Success", + "type": "string" + }, + "failure": { + "default": "final_failure", + "title": "When Failure", + "type": "string" + }, + "failure_timeout": { + "default": "final_failure_timeout", + "title": "When Failure Timeout", + "type": "string" + }, + "failure_retries": { + "default": "final_failure_retries", + "title": "When Failure Retries", + "type": "string" + }, + "failure_exception": { + "default": "final_failure_exception", + "title": "When Failure Exception", + "type": "string" + }, + "failure_guard": { + "default": "final_failure_guard", + "title": "When Failure Guard", + "type": "string" + }, + "target": { + "type": "object", + "required": [ + "type", + "resourceID" + ], + "anyOf": [ + { + "title": "User Defined", + "additionalProperties": "True", + "properties": { + "type": { + "title": "Target type", + "type": "string", + "default": "", + "enum": [ + "VNF", + "VFMODULE", + "VM" + ] + }, + "resourceID": { + "title": "Target type", + "type": "string", + "default": "" + } + } + } + ] + } } + } } + } + }, + "guard_policies": { + "type": "array", + "format": "tabs-top", + "title": "Associated Guard policies", + "items": { + "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}", + "anyOf": [ + { + "title": "Guard MinMax", + "type": "object", + "properties": { + "policy-id": { + "type": "string", + "default": "guard.minmax.new", + "pattern": "^(guard.minmax\\..*)$" + }, + "content": { + "properties": { + "actor": { + "type": "string", + "enum": [ + "APPC", + "SO", + "VFC", + "SDNC", + "SDNR" + ] + }, + "recipe": { + "type": "string", + "enum": [ + "Restart", + "Rebuild", + "Migrate", + "Health-Check", + "ModifyConfig", + "VF Module Create", + "VF Module Delete", + "Reroute" + ] + }, + "targets": { + "type": "string", + "default": ".*" + }, + "clname": { + "type": "string", + "template": "{{loopName}}", + "watch": { + "loopName": "operational_policy.controlLoop.controlLoopName" + } + }, + "guardActiveStart": { + "type": "string", + "default": "00:00:00Z" + }, + "guardActiveEnd": { + "type": "string", + "default": "10:00:00Z" + }, + "min": { + "type": "string", + "default": "0" + }, + "max": { + "type": "string", + "default": "1" + } + } + } + } + }, + { + "title": "Guard Frequency", + "type": "object", + "properties": { + "policy-id": { + "type": "string", + "default": "guard.frequency.new", + "pattern": "^(guard.frequency\\..*)$" + }, + "content": { + "properties": { + "actor": { + "type": "string", + "enum": [ + "APPC", + "SO", + "VFC", + "SDNC", + "SDNR" + ] + }, + "recipe": { + "type": "string", + "enum": [ + "Restart", + "Rebuild", + "Migrate", + "Health-Check", + "ModifyConfig", + "VF Module Create", + "VF Module Delete", + "Reroute" + ] + }, + "targets": { + "type": "string", + "default": ".*" + }, + "clname": { + "type": "string", + "template": "{{loopName}}", + "watch": { + "loopName": "operational_policy.controlLoop.controlLoopName" + } + }, + "guardActiveStart": { + "type": "string", + "default": "00:00:00Z" + }, + "guardActiveEnd": { + "type": "string", + "default": "10:00:00Z" + }, + "limit": { + "type": "string" + }, + "timeWindow": { + "type": "string" + }, + "timeUnits": { + "type": "string", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "year" + ] + } + } + } + } + } + ] + } } + } } + diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file index 64ba559c1..7d694eb8b 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Apex/versions/1.0.0?connectionTimeToLive=5000/.file @@ -71,6 +71,8 @@ data_types: Map of values that identify the resource. If none are provided, it is assumed that the entity that generated the ONSET event will be the target. required: false + metadata: + clamp_possible_values: test entry_schema: type: string @@ -82,10 +84,14 @@ data_types: type: string description: The actor performing the operation. required: true + metadata: + clamp_possible_values: test operation: type: string description: The operation the actor is performing. required: true + metadata: + clamp_possible_values: test target: type: onap.datatype.controlloop.Target description: The resource the operation should be performed on. @@ -115,8 +121,6 @@ data_types: type: onap.datatype.controlloop.Actor description: The definition of the operation to be performed. required: true - metadata: - clamp_possible_values: test timeout: type: integer description: The amount of time for the actor to perform the operation. diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file index 1c082b1ee..240009932 100644 --- a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0?connectionTimeToLive=5000/.file @@ -59,6 +59,8 @@ data_types: Map of values that identify the resource. If none are provided, it is assumed that the entity that generated the ONSET event will be the target. required: false + metadata: + clamp_possible_values: test entry_schema: type: string @@ -70,10 +72,14 @@ data_types: type: string description: The actor performing the operation. required: true + metadata: + clamp_possible_values: test operation: type: string description: The operation the actor is performing. required: true + metadata: + clamp_possible_values: test target: type: onap.datatype.controlloop.Target description: The resource the operation should be performed on. @@ -103,8 +109,6 @@ data_types: type: onap.datatype.controlloop.Actor description: The definition of the operation to be performed. required: true - metadata: - clamp_possible_values: test timeout: type: integer description: The amount of time for the actor to perform the operation. diff --git a/src/test/resources/tosca/operational-policy-json-schema.json b/src/test/resources/tosca/operational-policy-json-schema.json index b43f6f9d4..6ab84a8cf 100644 --- a/src/test/resources/tosca/operational-policy-json-schema.json +++ b/src/test/resources/tosca/operational-policy-json-schema.json @@ -1,760 +1,734 @@ { - "schema": { - "uniqueItems": "true", - "format": "tabs", - "type": "array", - "minItems": 1, - "maxItems": 1, - "title": "Operational policies", - "items": { - "type": "object", - "title": "Operational Policy Item", - "id": "operational_policy_item", - "headerTemplate": "{{self.name}}", - "required": [ - "name", - "configurationsJson" - ], - "properties": { - "name": { - "type": "string", - "title": "Operational policy name", - "readOnly": "True" - }, - "configurationsJson": { - "type": "object", - "title": "Configuration", - "required": [ - "operational_policy", - "guard_policies" - ], - "properties": { - "operational_policy": { - "type": "object", - "title": "Related Parameters", - "required": [ - "controlLoop", - "policies" - ], - "properties": { - "controlLoop": { - "type": "object", - "title": "Control Loop details", - "required": [ - "timeout", - "abatement", - "trigger_policy", - "controlLoopName" - ], - "properties": { - "timeout": { - "type": "string", - "title": "Overall Time Limit", - "default": "0", - "format": "number" - }, - "abatement": { - "type": "string", - "title": "Abatement", - "enum": [ - "True", - "False" - ] - }, - "trigger_policy": { - "type": "string", - "title": "Policy Decision Entry" - }, - "controlLoopName": { - "type": "string", - "title": "Control loop name", - "readOnly": "True" - } - } - }, - "policies": { - "uniqueItems": "true", - "id": "policies_array", - "type": "array", - "title": "Policy Decision Tree", - "format": "tabs-top", - "items": { - "title": "Policy Decision", - "type": "object", - "id": "policy_item", - "headerTemplate": "{{self.id}} - {{self.recipe}}", - "format": "categories", - "basicCategoryTitle": "recipe", - "required": [ - "id", - "retry", - "timeout", - "actor", - "success", - "failure", - "failure_timeout", - "failure_retries", - "failure_exception", - "failure_guard", - "target" - ], - "properties": { - "id": { - "default": "Policy 1", - "title": "Policy ID", - "type": "string" - }, - "retry": { - "default": "0", - "title": "Number of Retry", - "type": "string", - "format": "number" - }, - "timeout": { - "default": "0", - "title": "Timeout", - "type": "string", - "format": "number" - }, - "actor": { - "type": "object", - "title": "Actor", - "anyOf": [ - { - "title": "APPC", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "APPC", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "default": "", - "enum": [ - "Restart", - "Rebuild", - "Migrate", - "Health-Check", - "ModifyConfig" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "SO", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "SO", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "default": "", - "enum": [ - "VF Module Create", - "VF Module Delete" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "SDNC", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "SDNC", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "default": "", - "enum": [ - "Reroute", - "BandwidthOnDemand" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "VFC", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "VFC", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "string", - "required": [ - "payload" - ], - "default": "", - "enum": [ - "ModifyConfig" - ] - }, - "payload": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "CDS", - "properties": { - "actor": { - "title": "actor", - "type": "string", - "default": "CDS", - "options": { - "hidden": true - } - }, - "type": { - "title": "recipe", - "type": "object", - "required": [ - "payload" - ], - "anyOf": [ - { - "title": "user-defined", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "format": "textarea" - } - } - }, - { - "title": "resource-assignment", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default": "'artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : '\\'{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\''", - "format": "textarea" - } - } - }, - { - "title": "activate", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default": "'artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : '\\'{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\''", - "format": "textarea" - } - } - }, - { - "title": "activate-restconf", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default": "'artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : '\\'{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\''", - "format": "textarea" - } - } - }, - { - "title": "activate-cli", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default": "'artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : '\\'{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\''", - "format": "textarea" - } - } - }, - { - "title": "assign-activate", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default": "'artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : '\\'{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\''", - "format": "textarea" - } - } - }, - { - "title": "imperative-test-wf", - "properties": { - "type": { - "title": "Payload (YAML)", - "type": "string", - "default": "'artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : '\\'{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\''", - "format": "textarea" - } - } - } - ] - } - } - } - ] - }, - "success": { - "default": "final_success", - "title": "When Success", - "type": "string" - }, - "failure": { - "default": "final_failure", - "title": "When Failure", - "type": "string" - }, - "failure_timeout": { - "default": "final_failure_timeout", - "title": "When Failure Timeout", - "type": "string" - }, - "failure_retries": { - "default": "final_failure_retries", - "title": "When Failure Retries", - "type": "string" - }, - "failure_exception": { - "default": "final_failure_exception", - "title": "When Failure Exception", - "type": "string" - }, - "failure_guard": { - "default": "final_failure_guard", - "title": "When Failure Guard", - "type": "string" - }, - "target": { - "type": "object", - "required": [ - "type", - "resourceID" - ], - "anyOf": [ - { - "title": "User Defined", - "additionalProperties": "True", - "properties": { - "type": { - "title": "Target type", - "type": "string", - "default": "", - "enum": [ - "VNF", - "VFMODULE", - "VM" - ] - }, - "resourceID": { - "title": "Target type", - "type": "string", - "default": "" - } - } - }, - { - "title": "VNF-vLoadBalancerMS 0", - "properties": { - "type": { - "title": "Type", - "type": "string", - "default": "VNF", - "readOnly": "True" - }, - "resourceID": { - "title": "Resource ID", - "type": "string", - "default": "vLoadBalancerMS", - "readOnly": "True" - } - } - }, - { - "title": "VFMODULE-Vloadbalancerms..vpkg..module-1", - "properties": { - "type": { - "title": "Type", - "type": "string", - "default": "VFMODULE", - "readOnly": "True" - }, - "resourceID": { - "title": "Resource ID", - "type": "string", - "default": "Vloadbalancerms..vpkg..module-1", - "readOnly": "True" - }, - "modelInvariantId": { - "title": "Model Invariant Id (ModelInvariantUUID)", - "type": "string", - "default": "ca052563-eb92-4b5b-ad41-9111768ce043", - "readOnly": "True" - }, - "modelVersionId": { - "title": "Model Version Id (ModelUUID)", - "type": "string", - "default": "1e725ccc-b823-4f67-82b9-4f4367070dbc", - "readOnly": "True" - }, - "modelName": { - "title": "Model Name", - "type": "string", - "default": "Vloadbalancerms..vpkg..module-1", - "readOnly": "True" - }, - "modelVersion": { - "title": "Model Version", - "type": "string", - "default": "1", - "readOnly": "True" - }, - "modelCustomizationId": { - "title": "Customization ID", - "type": "string", - "default": "1bffdc31-a37d-4dee-b65c-dde623a76e52", - "readOnly": "True" - } - } - }, - { - "title": "VFMODULE-Vloadbalancerms..vdns..module-3", - "properties": { - "type": { - "title": "Type", - "type": "string", - "default": "VFMODULE", - "readOnly": "True" - }, - "resourceID": { - "title": "Resource ID", - "type": "string", - "default": "Vloadbalancerms..vdns..module-3", - "readOnly": "True" - }, - "modelInvariantId": { - "title": "Model Invariant Id (ModelInvariantUUID)", - "type": "string", - "default": "4c10ba9b-f88f-415e-9de3-5d33336047fa", - "readOnly": "True" - }, - "modelVersionId": { - "title": "Model Version Id (ModelUUID)", - "type": "string", - "default": "4fa73b49-8a6c-493e-816b-eb401567b720", - "readOnly": "True" - }, - "modelName": { - "title": "Model Name", - "type": "string", - "default": "Vloadbalancerms..vdns..module-3", - "readOnly": "True" - }, - "modelVersion": { - "title": "Model Version", - "type": "string", - "default": "1", - "readOnly": "True" - }, - "modelCustomizationId": { - "title": "Customization ID", - "type": "string", - "default": "bafcdab0-801d-4d81-9ead-f464640a38b1", - "readOnly": "True" - } - } - }, - { - "title": "VFMODULE-Vloadbalancerms..base_template..module-0", - "properties": { - "type": { - "title": "Type", - "type": "string", - "default": "VFMODULE", - "readOnly": "True" - }, - "resourceID": { - "title": "Resource ID", - "type": "string", - "default": "Vloadbalancerms..base_template..module-0", - "readOnly": "True" - }, - "modelInvariantId": { - "title": "Model Invariant Id (ModelInvariantUUID)", - "type": "string", - "default": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3", - "readOnly": "True" - }, - "modelVersionId": { - "title": "Model Version Id (ModelUUID)", - "type": "string", - "default": "63734409-f745-4e4d-a38b-131638a0edce", - "readOnly": "True" - }, - "modelName": { - "title": "Model Name", - "type": "string", - "default": "Vloadbalancerms..base_template..module-0", - "readOnly": "True" - }, - "modelVersion": { - "title": "Model Version", - "type": "string", - "default": "1", - "readOnly": "True" - }, - "modelCustomizationId": { - "title": "Customization ID", - "type": "string", - "default": "86baddea-c730-4fb8-9410-cd2e17fd7f27", - "readOnly": "True" - } - } - }, - { - "title": "VFMODULE-Vloadbalancerms..vlb..module-2", - "properties": { - "type": { - "title": "Type", - "type": "string", - "default": "VFMODULE", - "readOnly": "True" - }, - "resourceID": { - "title": "Resource ID", - "type": "string", - "default": "Vloadbalancerms..vlb..module-2", - "readOnly": "True" - }, - "modelInvariantId": { - "title": "Model Invariant Id (ModelInvariantUUID)", - "type": "string", - "default": "a772a1f4-0064-412c-833d-4749b15828dd", - "readOnly": "True" - }, - "modelVersionId": { - "title": "Model Version Id (ModelUUID)", - "type": "string", - "default": "0f5c3f6a-650a-4303-abb6-fff3e573a07a", - "readOnly": "True" - }, - "modelName": { - "title": "Model Name", - "type": "string", - "default": "Vloadbalancerms..vlb..module-2", - "readOnly": "True" - }, - "modelVersion": { - "title": "Model Version", - "type": "string", - "default": "1", - "readOnly": "True" - }, - "modelCustomizationId": { - "title": "Customization ID", - "type": "string", - "default": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806", - "readOnly": "True" - } - } - } - ] - } - } - } - } - } - }, - "guard_policies": { - "type": "array", - "format": "tabs-top", - "title": "Associated Guard policies", - "items": { - "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}", - "anyOf": [ - { - "title": "Guard MinMax", - "type": "object", - "properties": { - "policy-id": { - "type": "string", - "default": "guard.minmax.new", - "pattern": "^(guard.minmax\\..*)$" - }, - "content": { - "properties": { - "actor": { - "type": "string", - "enum": [ - "APPC", - "SO", - "VFC", - "SDNC", - "SDNR" - ] - }, - "recipe": { - "type": "string", - "enum": [ - "Restart", - "Rebuild", - "Migrate", - "Health-Check", - "ModifyConfig", - "VF Module Create", - "VF Module Delete", - "Reroute" - ] - }, - "targets": { - "type": "string", - "default": ".*" - }, - "clname": { - "type": "string", - "template": "{{loopName}}", - "watch": { - "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName" - } - }, - "guardActiveStart": { - "type": "string", - "default": "00:00:00Z" - }, - "guardActiveEnd": { - "type": "string", - "default": "10:00:00Z" - }, - "min": { - "type": "string", - "default": "0" - }, - "max": { - "type": "string", - "default": "1" - } - } - } - } - }, - { - "title": "Guard Frequency", - "type": "object", - "properties": { - "policy-id": { - "type": "string", - "default": "guard.frequency.new", - "pattern": "^(guard.frequency\\..*)$" - }, - "content": { - "properties": { - "actor": { - "type": "string", - "enum": [ - "APPC", - "SO", - "VFC", - "SDNC", - "SDNR" - ] - }, - "recipe": { - "type": "string", - "enum": [ - "Restart", - "Rebuild", - "Migrate", - "Health-Check", - "ModifyConfig", - "VF Module Create", - "VF Module Delete", - "Reroute" - ] - }, - "targets": { - "type": "string", - "default": ".*" - }, - "clname": { - "type": "string", - "template": "{{loopName}}", - "watch": { - "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName" - } - }, - "guardActiveStart": { - "type": "string", - "default": "00:00:00Z" - }, - "guardActiveEnd": { - "type": "string", - "default": "10:00:00Z" - }, - "limit": { - "type": "string" - }, - "timeWindow": { - "type": "string" - }, - "timeUnits": { - "type": "string", - "enum": [ - "minute", - "hour", - "day", - "week", - "month", - "year" - ] - } - } - } - } - } - ] - } - } - } - } - } - } - } + "type": "object", + "title": "Configuration", + "required": [ + "operational_policy", + "guard_policies" + ], + "properties": { + "operational_policy": { + "type": "object", + "title": "Related Parameters", + "required": [ + "controlLoop", + "policies" + ], + "properties": { + "controlLoop": { + "type": "object", + "title": "Control Loop details", + "required": [ + "timeout", + "abatement", + "trigger_policy", + "controlLoopName" + ], + "properties": { + "timeout": { + "type": "string", + "title": "Overall Time Limit", + "default": "0", + "format": "number" + }, + "abatement": { + "type": "string", + "title": "Abatement", + "enum": [ + "True", + "False" + ] + }, + "trigger_policy": { + "type": "string", + "title": "Policy Decision Entry" + }, + "controlLoopName": { + "type": "string", + "title": "Control loop name", + "readOnly": "True" + } + } + }, + "policies": { + "uniqueItems": "true", + "id": "policies_array", + "type": "array", + "title": "Policy Decision Tree", + "format": "tabs-top", + "items": { + "title": "Policy Decision", + "type": "object", + "id": "policy_item", + "headerTemplate": "{{self.id}} - {{self.recipe}}", + "format": "categories", + "basicCategoryTitle": "recipe", + "required": [ + "id", + "retry", + "timeout", + "actor", + "success", + "failure", + "failure_timeout", + "failure_retries", + "failure_exception", + "failure_guard", + "target" + ], + "properties": { + "id": { + "default": "Policy 1", + "title": "Policy ID", + "type": "string" + }, + "retry": { + "default": "0", + "title": "Number of Retry", + "type": "string", + "format": "number" + }, + "timeout": { + "default": "0", + "title": "Timeout", + "type": "string", + "format": "number" + }, + "actor": { + "type": "object", + "title": "Actor", + "anyOf": [ + { + "title": "APPC", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "APPC", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "default": "", + "enum": [ + "Restart", + "Rebuild", + "Migrate", + "Health-Check", + "ModifyConfig" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "SO", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "SO", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "default": "", + "enum": [ + "VF Module Create", + "VF Module Delete" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "SDNC", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "SDNC", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "default": "", + "enum": [ + "Reroute", + "BandwidthOnDemand" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "VFC", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "VFC", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "string", + "required": [ + "payload" + ], + "default": "", + "enum": [ + "ModifyConfig" + ] + }, + "payload": { + "title": "Payload (YAML)", + "type": "string", + "format": "textarea" + } + } + }, + { + "title": "CDS", + "properties": { + "actor": { + "title": "actor", + "type": "string", + "default": "CDS", + "options": { + "hidden": true + } + }, + "type": { + "title": "recipe", + "type": "object", + "required": [ + "payload" + ], + "anyOf": [ + { + "title": "user-defined", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "", + "format": "textarea" + } + } + }, + { + "title": "resource-assignment", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027", + "format": "textarea" + } + } + }, + { + "title": "activate", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027", + "format": "textarea" + } + } + }, + { + "title": "activate-restconf", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027", + "format": "textarea" + } + } + }, + { + "title": "activate-cli", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027", + "format": "textarea" + } + } + }, + { + "title": "assign-activate", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027", + "format": "textarea" + } + } + }, + { + "title": "imperative-test-wf", + "properties": { + "type": { + "title": "Payload (YAML)", + "type": "string", + "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027", + "format": "textarea" + } + } + } + ] + } + } + } + ] + }, + "success": { + "default": "final_success", + "title": "When Success", + "type": "string" + }, + "failure": { + "default": "final_failure", + "title": "When Failure", + "type": "string" + }, + "failure_timeout": { + "default": "final_failure_timeout", + "title": "When Failure Timeout", + "type": "string" + }, + "failure_retries": { + "default": "final_failure_retries", + "title": "When Failure Retries", + "type": "string" + }, + "failure_exception": { + "default": "final_failure_exception", + "title": "When Failure Exception", + "type": "string" + }, + "failure_guard": { + "default": "final_failure_guard", + "title": "When Failure Guard", + "type": "string" + }, + "target": { + "type": "object", + "required": [ + "type", + "resourceID" + ], + "anyOf": [ + { + "title": "User Defined", + "additionalProperties": "True", + "properties": { + "type": { + "title": "Target type", + "type": "string", + "default": "", + "enum": [ + "VNF", + "VFMODULE", + "VM" + ] + }, + "resourceID": { + "title": "Target type", + "type": "string", + "default": "" + } + } + }, + { + "title": "VNF-vLoadBalancerMS 0", + "properties": { + "type": { + "title": "Type", + "type": "string", + "default": "VNF", + "readOnly": "True" + }, + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "vLoadBalancerMS", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..vpkg..module-1", + "properties": { + "type": { + "title": "Type", + "type": "string", + "default": "VFMODULE", + "readOnly": "True" + }, + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..vpkg..module-1", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "ca052563-eb92-4b5b-ad41-9111768ce043", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "1e725ccc-b823-4f67-82b9-4f4367070dbc", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..vpkg..module-1", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "1bffdc31-a37d-4dee-b65c-dde623a76e52", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..vdns..module-3", + "properties": { + "type": { + "title": "Type", + "type": "string", + "default": "VFMODULE", + "readOnly": "True" + }, + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..vdns..module-3", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "4c10ba9b-f88f-415e-9de3-5d33336047fa", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "4fa73b49-8a6c-493e-816b-eb401567b720", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..vdns..module-3", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "bafcdab0-801d-4d81-9ead-f464640a38b1", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..base_template..module-0", + "properties": { + "type": { + "title": "Type", + "type": "string", + "default": "VFMODULE", + "readOnly": "True" + }, + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..base_template..module-0", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "63734409-f745-4e4d-a38b-131638a0edce", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..base_template..module-0", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "86baddea-c730-4fb8-9410-cd2e17fd7f27", + "readOnly": "True" + } + } + }, + { + "title": "VFMODULE-Vloadbalancerms..vlb..module-2", + "properties": { + "type": { + "title": "Type", + "type": "string", + "default": "VFMODULE", + "readOnly": "True" + }, + "resourceID": { + "title": "Resource ID", + "type": "string", + "default": "Vloadbalancerms..vlb..module-2", + "readOnly": "True" + }, + "modelInvariantId": { + "title": "Model Invariant Id (ModelInvariantUUID)", + "type": "string", + "default": "a772a1f4-0064-412c-833d-4749b15828dd", + "readOnly": "True" + }, + "modelVersionId": { + "title": "Model Version Id (ModelUUID)", + "type": "string", + "default": "0f5c3f6a-650a-4303-abb6-fff3e573a07a", + "readOnly": "True" + }, + "modelName": { + "title": "Model Name", + "type": "string", + "default": "Vloadbalancerms..vlb..module-2", + "readOnly": "True" + }, + "modelVersion": { + "title": "Model Version", + "type": "string", + "default": "1", + "readOnly": "True" + }, + "modelCustomizationId": { + "title": "Customization ID", + "type": "string", + "default": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806", + "readOnly": "True" + } + } + } + ] + } + } + } + } + } + }, + "guard_policies": { + "type": "array", + "format": "tabs-top", + "title": "Associated Guard policies", + "items": { + "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}", + "anyOf": [ + { + "title": "Guard MinMax", + "type": "object", + "properties": { + "policy-id": { + "type": "string", + "default": "guard.minmax.new", + "pattern": "^(guard.minmax\\..*)$" + }, + "content": { + "properties": { + "actor": { + "type": "string", + "enum": [ + "APPC", + "SO", + "VFC", + "SDNC", + "SDNR" + ] + }, + "recipe": { + "type": "string", + "enum": [ + "Restart", + "Rebuild", + "Migrate", + "Health-Check", + "ModifyConfig", + "VF Module Create", + "VF Module Delete", + "Reroute" + ] + }, + "targets": { + "type": "string", + "default": ".*" + }, + "clname": { + "type": "string", + "template": "{{loopName}}", + "watch": { + "loopName": "operational_policy.controlLoop.controlLoopName" + } + }, + "guardActiveStart": { + "type": "string", + "default": "00:00:00Z" + }, + "guardActiveEnd": { + "type": "string", + "default": "10:00:00Z" + }, + "min": { + "type": "string", + "default": "0" + }, + "max": { + "type": "string", + "default": "1" + } + } + } + } + }, + { + "title": "Guard Frequency", + "type": "object", + "properties": { + "policy-id": { + "type": "string", + "default": "guard.frequency.new", + "pattern": "^(guard.frequency\\..*)$" + }, + "content": { + "properties": { + "actor": { + "type": "string", + "enum": [ + "APPC", + "SO", + "VFC", + "SDNC", + "SDNR" + ] + }, + "recipe": { + "type": "string", + "enum": [ + "Restart", + "Rebuild", + "Migrate", + "Health-Check", + "ModifyConfig", + "VF Module Create", + "VF Module Delete", + "Reroute" + ] + }, + "targets": { + "type": "string", + "default": ".*" + }, + "clname": { + "type": "string", + "template": "{{loopName}}", + "watch": { + "loopName": "operational_policy.controlLoop.controlLoopName" + } + }, + "guardActiveStart": { + "type": "string", + "default": "00:00:00Z" + }, + "guardActiveEnd": { + "type": "string", + "default": "10:00:00Z" + }, + "limit": { + "type": "string" + }, + "timeWindow": { + "type": "string" + }, + "timeUnits": { + "type": "string", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "year" + ] + } + } + } + } + } + ] + } + } + } } \ No newline at end of file -- cgit 1.2.3-korg