diff options
author | aditya.puthuparambil <aditya.puthuparambil@est.tech> | 2020-06-15 12:13:49 +0100 |
---|---|---|
committer | aditya.puthuparambil <aditya.puthuparambil@est.tech> | 2020-06-15 12:33:22 +0100 |
commit | 07e4b4fa99ccab385e8e295c8caedf96b5cb0620 (patch) | |
tree | eda0a4790302e4387521ecb0c82524ec4de23100 /main/src | |
parent | d5fa90efb8a49875924a88094d1369b15e979b89 (diff) |
Removing duplicate yamls and jsons
Issue-ID: POLICY-2052
Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech>
Change-Id: Ib4125baa1415cdc7f8a34fabc21fa322bc9b82a1
Diffstat (limited to 'main/src')
3 files changed, 48 insertions, 440 deletions
diff --git a/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java b/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java index d5ea4d95..c3c81f6b 100644 --- a/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java +++ b/main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java @@ -80,6 +80,7 @@ import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy; * @author Chenfei Gao (cgao@research.att.com) */ public class TestApiRestServer { + private static final String ALIVE = "alive"; private static final String SELF = NetworkUtil.getHostname(); private static final String NAME = "Policy API"; @@ -118,8 +119,6 @@ public class TestApiRestServer { "policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca"; private static final String POLICYTYPES_TCA_POLICIES_VCPE_VERSION1 = "policytypes/" + "onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/1.0.0"; - private static final String POLICYTYPES_TCA_POLICIES_VCPE_VERSION2 = "policytypes/" - + "onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0"; private static final String POLICYTYPES_TCA_POLICIES_VCPE_LATEST = "policytypes/" + "onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/latest"; @@ -140,30 +139,29 @@ public class TestApiRestServer { private static final String OPS_POLICIES_VFIREWALL_LATEST = "policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VFW + "/versions/latest"; - private static final String OPS_POLICIES_VCPE_VERSION = "policytypes/" - + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VCPE + "/versions/1"; - private static final String OPS_POLICIES_VDNS_VERSION = "policytypes/" - + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VDNS + "/versions/1"; - private static final String OPS_POLICIES_VFIREWALL_VERSION = "policytypes/" - + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VFW + "/versions/1"; - private static final String OPS_POLICIES_VCPE_VERSION_NOEX = "policytypes/" - + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VCPE + "/versions/99"; + private static final String OPS_POLICIES_VCPE_VERSION = + "policytypes/" + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VCPE + + "/versions/1"; + private static final String OPS_POLICIES_VDNS_VERSION = + "policytypes/" + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VDNS + + "/versions/1"; + private static final String OPS_POLICIES_VFIREWALL_VERSION = + "policytypes/" + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VFW + + "/versions/1"; + private static final String OPS_POLICIES_VCPE_VERSION_NOEX = + "policytypes/" + "onap.policies.controlloop.Operational/versions/1.0.0/policies/" + OP_POLICY_NAME_VCPE + + "/versions/99"; private static final String POLICIES = "policies"; private static final String KEYSTORE = System.getProperty("user.dir") + "/src/test/resources/ssl/policy-keystore"; // @formatter:off - private static final String[] TOSCA_POLICY_RESOURCE_NAMES = { - "policies/vCPE.policy.monitoring.input.tosca.json", - "policies/vCPE.policy.monitoring.input.tosca.v2.yaml", - "policies/vDNS.policy.monitoring.input.tosca.json", - "policies/vDNS.policy.monitoring.input.tosca.v2.yaml" - }; + private static final String[] TOSCA_POLICY_RESOURCE_NAMES = {"policies/vCPE.policy.monitoring.input.tosca.json", + "policies/vCPE.policy.monitoring.input.tosca.yaml", "policies/vDNS.policy.monitoring.input.tosca.json", + "policies/vDNS.policy.monitoring.input.tosca.v2.yaml"}; private static final String[] TOSCA_POLICIES_RESOURCE_NAMES = { - "policies/vCPE.policies.optimization.input.tosca.json", - "policies/vCPE.policies.optimization.input.tosca.v2.yaml" - }; + "policies/vCPE.policies.optimization.input.tosca.json", "policies/vCPE.policies.optimization.input.tosca.yaml"}; private static final String TOSCA_POLICYTYPE_OP_RESOURCE = "policytypes/onap.policies.controlloop.operational.Common.yaml"; @@ -174,9 +172,7 @@ public class TestApiRestServer { private static final String[] TOSCA_POLICYTYPE_RESOURCE_NAMES = { "policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml", "policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml", - "policytypes/onap.policies.Optimization.yaml", - LEGACY_POLICYTYPE_OP_RESOURCE, - TOSCA_POLICYTYPE_OP_RESOURCE, + "policytypes/onap.policies.Optimization.yaml", LEGACY_POLICYTYPE_OP_RESOURCE, TOSCA_POLICYTYPE_OP_RESOURCE, "policytypes/onap.policies.controlloop.operational.common.Drools.yaml", "policytypes/onap.policies.controlloop.guard.Common.yaml", "policytypes/onap.policies.controlloop.guard.common.Blacklist.yaml", @@ -191,8 +187,7 @@ public class TestApiRestServer { "policytypes/onap.policies.optimization.service.QueryPolicy.yaml", "policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml", "policytypes/onap.policies.optimization.resource.Vim_fit.yaml", - "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml" - }; + "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml"}; private static final String TOSCA_POLICY_OP_DROOLS_VCPE_RESOURSE_JSON = "policies/vCPE.policy.operational.input.tosca.json"; @@ -201,10 +196,8 @@ public class TestApiRestServer { "policies/vCPE.policy.operational.input.tosca.yaml"; private static final String[] LEGACY_OPERATIONAL_POLICY_RESOURCE_NAMES = { - "policies/vCPE.policy.operational.legacy.input.json", - "policies/vDNS.policy.operational.legacy.input.json", - "policies/vFirewall.policy.operational.legacy.input.json" - }; + "policies/vCPE.policy.operational.legacy.input.json", "policies/vDNS.policy.operational.legacy.input.json", + "policies/vFirewall.policy.operational.legacy.input.json"}; private static PolicyModelsProviderParameters providerParams; private static ApiParameterGroup apiParamGroup; @@ -224,7 +217,7 @@ public class TestApiRestServer { * Initializes parameters and set up test environment. * * @throws PfModelException the PfModel parsing exception - * @throws IOException on I/O exceptions + * @throws IOException on I/O exceptions */ @BeforeClass public static void setupParameters() throws PfModelException, IOException { @@ -235,8 +228,8 @@ public class TestApiRestServer { providerParams.setDatabaseUser("policy"); providerParams.setDatabasePassword(Base64.getEncoder().encodeToString("P01icY".getBytes())); providerParams.setPersistenceUnit("ToscaConceptTest"); - apiParamGroup = - new ApiParameterGroup("ApiGroup", null, providerParams, Collections.emptyList(), Collections.emptyList()); + apiParamGroup = new ApiParameterGroup("ApiGroup", null, providerParams, Collections.emptyList(), + Collections.emptyList()); ParameterService.register(apiParamGroup, true); policyTypeProvider = new PolicyTypeProvider(); @@ -316,14 +309,14 @@ public class TestApiRestServer { new File("src/test/resources/policies/BadTestPolicy.yaml").deleteOnExit(); // Send a policy with no policy type trigger an error - String toscaPolicy = - ResourceUtils.getResourceAsString(TOSCA_POLICY_RESOURCE_NAMES[TOSCA_POLICIES_RESOURCE_NAMES.length - 1]); + String toscaPolicy = ResourceUtils + .getResourceAsString(TOSCA_POLICY_RESOURCE_NAMES[TOSCA_POLICIES_RESOURCE_NAMES.length - 1]); toscaPolicy = toscaPolicy.replaceAll("onap.policies.monitoring.cdap.tca.hi.lo.app", "IDontExist"); TextFileUtils.putStringAsTextFile(toscaPolicy, "src/test/resources/policies/BadTestPolicy.yaml"); - Response rawResponse2 = - createResource(POLICYTYPES_TCA_POLICIES, "src/test/resources/policies/BadTestPolicy.yaml"); + Response rawResponse2 = createResource(POLICYTYPES_TCA_POLICIES, + "src/test/resources/policies/BadTestPolicy.yaml"); assertEquals(Response.Status.NOT_ACCEPTABLE.getStatusCode(), rawResponse2.getStatus()); ErrorResponse errorResponse = rawResponse2.readEntity(ErrorResponse.class); assertThat(errorResponse.getErrorMessage()) @@ -340,8 +333,8 @@ public class TestApiRestServer { new File("src/test/resources/policies/BadTestPolicy.yaml").deleteOnExit(); // Send a policy with no policy type trigger an error - String toscaPolicy = - ResourceUtils.getResourceAsString(TOSCA_POLICY_RESOURCE_NAMES[TOSCA_POLICIES_RESOURCE_NAMES.length - 1]); + String toscaPolicy = ResourceUtils + .getResourceAsString(TOSCA_POLICY_RESOURCE_NAMES[TOSCA_POLICIES_RESOURCE_NAMES.length - 1]); toscaPolicy = toscaPolicy.replaceAll("onap.policies.monitoring.cdap.tca.hi.lo.app", "IDontExist"); TextFileUtils.putStringAsTextFile(toscaPolicy, "src/test/resources/policies/BadTestPolicy.yaml"); @@ -407,16 +400,16 @@ public class TestApiRestServer { assertEquals(OP_POLICY_NAME_VCPE, toscaVcpeSt.getToscaTopologyTemplate().getPolicies().get(0).get(OP_POLICY_NAME_VCPE).getName()); - Map<String, Object> props = - toscaVcpeSt.getToscaTopologyTemplate().getPolicies().get(0).get(OP_POLICY_NAME_VCPE).getProperties(); + Map<String, Object> props = toscaVcpeSt.getToscaTopologyTemplate().getPolicies().get(0).get(OP_POLICY_NAME_VCPE) + .getProperties(); assertNotNull(props); List<Object> operations = (List<Object>) props.get("operations"); assertEquals(1, operations.size()); assertEquals(props.get("trigger"), ((Map<String, Object>) operations.get(0)).get("id")); - Map<String, Object> operation = - (Map<String, Object>) ((Map<String, Object>) operations.get(0)).get("operation"); + Map<String, Object> operation = (Map<String, Object>) ((Map<String, Object>) operations.get(0)) + .get("operation"); assertEquals("APPC", operation.get("actor")); assertEquals("Restart", operation.get("operation")); @@ -567,17 +560,12 @@ public class TestApiRestServer { rawResponse = readResource(POLICYTYPES_TCA_POLICIES_VCPE_VERSION1, mediaType); assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); - rawResponse = readResource(POLICYTYPES_TCA_POLICIES_VCPE_VERSION2, mediaType); - assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); - rawResponse = readResource(POLICYTYPES_TCA_POLICIES_VCPE_LATEST, mediaType); assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); rawResponse = deleteResource(POLICYTYPES_TCA_POLICIES_VCPE_VERSION1, mediaType); assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); - rawResponse = deleteResource(POLICYTYPES_TCA_POLICIES_VCPE_VERSION2, mediaType); - assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); } @Test @@ -605,8 +593,8 @@ public class TestApiRestServer { assertEquals(1, namingServiceTemplate.getPolicyTypesAsMap().size()); assertEquals(3, namingServiceTemplate.getDataTypesAsMap().size()); - rawResponse = - readResource("policytypes/onap.policies.Naming/versions/1.0.0/policies?mode=referenced", APP_JSON); + rawResponse = readResource("policytypes/onap.policies.Naming/versions/1.0.0/policies?mode=referenced", + APP_JSON); assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); namingServiceTemplate = rawResponse.readEntity(ToscaServiceTemplate.class); @@ -689,14 +677,6 @@ public class TestApiRestServer { ErrorResponse errorResponse = rawResponse.readEntity(ErrorResponse.class); assertEquals("policies for onap.restart.tca:1.0.0 do not exist", errorResponse.getErrorMessage()); - rawResponse = deleteResource(POLICYTYPES_TCA_POLICIES_VCPE_VERSION2, mediaType); - assertEquals(Response.Status.OK.getStatusCode(), rawResponse.getStatus()); - - rawResponse = readResource(POLICYTYPES_TCA_POLICIES_VCPE_VERSION2, mediaType); - assertEquals(Response.Status.NOT_FOUND.getStatusCode(), rawResponse.getStatus()); - errorResponse = rawResponse.readEntity(ErrorResponse.class); - assertEquals("policies for onap.restart.tca:2.0.0 do not exist", errorResponse.getErrorMessage()); - rawResponse = readResource(POLICYTYPES_TCA_POLICIES_VCPE, mediaType); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), rawResponse.getStatus()); errorResponse = rawResponse.readEntity(ErrorResponse.class); @@ -846,10 +826,8 @@ public class TestApiRestServer { Response rawResponse = readResource(OPS_POLICIES_VCPE_DEPLOYED, mediaType); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), rawResponse.getStatus()); ErrorResponse errorResponse = rawResponse.readEntity(ErrorResponse.class); - assertEquals( - "could not find policy with ID " + OP_POLICY_NAME_VCPE + " and type " - + "onap.policies.controlloop.Operational:1.0.0 deployed in any pdp group", - errorResponse.getErrorMessage()); + assertEquals("could not find policy with ID " + OP_POLICY_NAME_VCPE + " and type " + + "onap.policies.controlloop.Operational:1.0.0 deployed in any pdp group", errorResponse.getErrorMessage()); } @Test @@ -865,12 +843,12 @@ public class TestApiRestServer { String mediaType = APP_JSON; // default media type ToscaServiceTemplate rawServiceTemplate = new ToscaServiceTemplate(); if (resourceName.endsWith(".json")) { - rawServiceTemplate = - standardCoder.decode(ResourceUtils.getResourceAsString(resourceName), ToscaServiceTemplate.class); + rawServiceTemplate = standardCoder + .decode(ResourceUtils.getResourceAsString(resourceName), ToscaServiceTemplate.class); } else if (resourceName.endsWith(".yaml") || resourceName.endsWith(".yml")) { mediaType = APP_YAML; - rawServiceTemplate = - standardYamlCoder.decode(ResourceUtils.getResourceAsString(resourceName), ToscaServiceTemplate.class); + rawServiceTemplate = standardYamlCoder + .decode(ResourceUtils.getResourceAsString(resourceName), ToscaServiceTemplate.class); } final Invocation.Builder invocationBuilder; @@ -886,12 +864,12 @@ public class TestApiRestServer { String mediaType = APP_JSON; // default media type LegacyOperationalPolicy rawOpsPolicy = new LegacyOperationalPolicy(); if (resourceName.endsWith(".json")) { - rawOpsPolicy = - standardCoder.decode(ResourceUtils.getResourceAsString(resourceName), LegacyOperationalPolicy.class); + rawOpsPolicy = standardCoder + .decode(ResourceUtils.getResourceAsString(resourceName), LegacyOperationalPolicy.class); } else if (resourceName.endsWith(".yaml") || resourceName.endsWith(".yml")) { mediaType = APP_YAML; - rawOpsPolicy = standardYamlCoder.decode(ResourceUtils.getResourceAsString(resourceName), - LegacyOperationalPolicy.class); + rawOpsPolicy = standardYamlCoder + .decode(ResourceUtils.getResourceAsString(resourceName), LegacyOperationalPolicy.class); } final Invocation.Builder invocationBuilder; @@ -927,8 +905,8 @@ public class TestApiRestServer { final SSLContext sc = SSLContext.getInstance("TLSv1.2"); sc.init(null, noopTrustManager, new SecureRandom()); - final ClientBuilder clientBuilder = - ClientBuilder.newBuilder().sslContext(sc).hostnameVerifier((host, session) -> true); + final ClientBuilder clientBuilder = ClientBuilder.newBuilder().sslContext(sc) + .hostnameVerifier((host, session) -> true); final Client client = clientBuilder.build(); final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("healthcheck", "zb!XztG34"); client.register(feature); diff --git a/main/src/test/resources/policies/vCPE.policies.optimization.input.tosca.v2.yaml b/main/src/test/resources/policies/vCPE.policies.optimization.input.tosca.v2.yaml deleted file mode 100644 index e87e353d..00000000 --- a/main/src/test/resources/policies/vCPE.policies.optimization.input.tosca.v2.yaml +++ /dev/null @@ -1,333 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_1_0 -topology_template: - policies: - - - OSDF_CASABLANCA.Affinity_Default: - type: onap.policies.optimization.resource.AffinityPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Affinity_Default - policy-version: 2 - properties: - scope: [] - services: [] - resources: [] - geography: [] - identity: affinity_vCPE - applicableResources: any - affinityProperties: - qualifier: same - category: complex - - - OSDF_CASABLANCA.Affinity_Default_US: - type: onap.policies.optimization.resource.AffinityPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Affinity_Default_US - policy-version: 2 - properties: - scope: [] - services: [] - resources: [] - geography: [US] - identity: affinity_vCPE - applicableResources: any - affinityProperties: - qualifier: same - category: complex - - - OSDF_CASABLANCA.Affinity_Default_vCPE_US_0: - type: onap.policies.optimization.resource.AffinityPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Affinity_Default_vCPE_US_0 - policy-version: 2 - properties: - scope: [] - services: [vCPE] - resources: [] - geography: [US] - identity: affinity_vCPE - applicableResources: any - affinityProperties: - qualifier: different - category: complex - - - OSDF_CASABLANCA.Affinity_vCPE_US_Gold_1: - type: onap.policies.optimization.resource.AffinityPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Affinity_vCPE_1 - policy-version: 2 - properties: - scope: [gold] - services: [vCPE] - resources: [vGMuxInfra, vG] - geography: [US, INTERNATIONAL] - identity: affinity_vCPE - applicableResources: any - affinityProperties: - qualifier: same - category: availabilityZone - - - OSDF_CASABLANCA.Affinity_vCPE_US_Platinum_1: - type: onap.policies.optimization.resource.AffinityPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Affinity_vCPE_1 - policy-version: 2 - properties: - scope: [platinum] - services: [vCPE] - resources: [vGMuxInfra, vG] - geography: [US, INTERNATIONAL] - identity: affinity_vCPE - applicableResources: any - affinityProperties: - qualifier: different - category: availabilityZone - - - OSDF_CASABLANCA.Capacity_vG_1: - type: onap.policies.optimization.resource.Vim_fit - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Capacity_vG_1 - policy-version: 2 - properties: - scope: [] - services: [vCPE] - resources: [vG] - geography: [US, INTERNATIONAL] - identity: capacity_vG - applicableResources: any - capacityProperty: - controller: multicloud - request: "{\"vCPU\": 10, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\"}, \"unit\": \"GB\"}}" - - - OSDF_CASABLANCA.Capacity_vG_2: - type: onap.policies.optimization.resource.Vim_fit - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Capacity_vG_2 - policy-version: 2 - properties: - scope: [] - services: [vCPE] - resources: [vG] - geography: [US, INTERNATIONAL] - identity: capacity_vG - applicableResources: any - capacityProperty: - controller: multicloud - request: "{\"vCPU\": 15, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"MB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\"}, \"unit\": \"GB\"}}" - - - OSDF_CASABLANCA.Distance_vG_1: - type: onap.policies.optimization.resource.DistancePolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.Distance_vG_1 - policy-version: 2 - properties: - scope: [platinum] - services: [vCPE] - resources: [vG] - geography: [US, INTERNATIONAL] - identity: distance-vG - applicableResources: any - distanceProperties: - locationInfo: customer_loc - distance: - value: 1500 - operator: "<" - unit: km - - - OSDF_CASABLANCA.hpa_policy_Default: - type: onap.policies.optimization.resource.HpaPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.hpa_policy_Default - policy-version: 2 - properties: - scope: [] - services: [] - resources: [] - geography: [] - identity: hpa-vG - flavorFeatures: - - - id: vg_1 - type: vnfc - directives: - - type: flavor_directives - attributes: - - attribute_name: flavor_label_vm_01 - attribute_value: "" - flavorProperties: - - - hpa-feature: basicCapabilities - mandatory: True - architecture: generic - directives: [] - hpa-feature-attributes: - - hpa-attribute-key: numVirtualCpu - hpa-attribute-value: 8 - operator: ['>='] - unit: "" - - hpa-attribute-key: virtualMemSize - hpa-attribute-value: 6 - operator: ['<='] - unit: "" - - - hpa-feature: ovsDpdk - mandatory: False - architecture: generic - directives: [] - hpa-feature-attributes: - - hpa-attribute-key: dataProcessingAccelerationLibrary - hpa-attribute-value: ovsDpdk_version - operator: [=] - unit: "" - - - OSDF_CASABLANCA.hpa_policy_vG_1: - type: onap.policies.optimization.resource.HpaPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.hpa_policy_vG_1 - policy-version: 2 - properties: - scope: [] - services: [vCPE, vOtherService] - resources: [vG] - geography: [] - identity: hpa-vG - flavorFeatures: - - - id: vg_1 - type: vnfc - directives: - - type: flavor_directives - attributes: - - attribute_name: flavor_label_vm_01 - attribute_value: "" - flavorProperties: - - - hpa-feature: basicCapabilities - mandatory: True - architecture: generic - directives: [] - hpa-feature-attributes: - - hpa-attribute-key: numVirtualCpu - hpa-attribute-value: 6 - operator: ['>='] - unit: "" - - hpa-attribute-key: virtualMemSize - hpa-attribute-value: 4 - operator: ['<='] - unit: "" - - - hpa-feature: ovsDpdk - mandatory: False - architecture: generic - directives: [] - hpa-feature-attributes: - - hpa-attribute-key: dataProcessingAccelerationLibrary - hpa-attribute-value: ovsDpdk_version - operator: [=] - unit: "" - - - OSDF_CASABLANCA.queryPolicy_vCPE: - type: onap.policies.optimization.service.QueryPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.queryPolicy_vCPE - policy-version: 2 - properties: - scope: [] - services: [vCPE] - geography: [US, INTERNATIONAL] - identity: vCPE_Query_Policy - queryProperties: - - - attribute: locationId - attribute_location: customerLocation - value: "" - - - attribute: id - attribute_location: "vpnInfo.vpnId" - value: "" - - - attribute: upstreamBW - attribute_location: "vpnInfo.upstreamBW" - value: "" - - - attribute: customerLatitude - attribute_location: customerLatitude - value: 1.1 - - - attribute: customerLongitude - attribute_location: customerLongitude - value: 2.2 - - - OSDF_CASABLANCA.SubscriberPolicy_v1: - type: onap.policies.optimization.service.SubscriberPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.SubscriberPolicy_v1 - policy-version: 2 - properties: - scope: [] - services: [vCPE] - identity: subscriber_vCPE - subscriberProperties: - subscriberName: [subscriber_x, subscriber_y] - subscriberRole: [platinum] - provStatus: [CAPPED] - - - OSDF_CASABLANCA.SubscriberPolicy_v2: - type: onap.policies.optimization.service.SubscriberPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.SubscriberPolicy_v2 - policy-version: 2 - properties: - scope: [] - services: [vCPE] - identity: subscriber_vCPE - subscriberProperties: - subscriberName: [subscriber_a, subscriber_b] - subscriberRole: [gold] - provStatus: [CAPPED] - - - OSDF_CASABLANCA.vnfPolicy_vG: - type: onap.policies.optimization.resource.VnfPolicy - version: 2.0.0 - type_version: 1.0.0 - metadata: - policy-id: OSDF_CASABLANCA.vnfPolicy_vG - policy-version: 2 - properties: - scope: [] - services: [vCPE] - resources: [vG] - geography: [US, INTERNATIONAL] - identity: vnf_vG - applicableResources: any - vnfProperties: - - - inventoryProvider: aai - serviceType: "" - inventoryType: cloudRegionId - customerId: "" diff --git a/main/src/test/resources/policies/vCPE.policy.monitoring.input.tosca.v2.yaml b/main/src/test/resources/policies/vCPE.policy.monitoring.input.tosca.v2.yaml deleted file mode 100644 index dc1991e8..00000000 --- a/main/src/test/resources/policies/vCPE.policy.monitoring.input.tosca.v2.yaml +++ /dev/null @@ -1,37 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_1_0 -topology_template: - policies: - - - onap.restart.tca: - type: onap.policies.monitoring.cdap.tca.hi.lo.app - type_version: 1.0.0 - version: 2.0.0 - metadata: - policy-id: onap.restart.tca - properties: - tca_policy: - domain: measurementsForVfScaling - metricsPerEventName: - - - eventName: Measurement_vGMUX - controlLoopSchemaType: VNF - policyScope: DCAE - policyName: "DCAE.Config_tca-hi-lo" - policyVersion: "v0.0.1" - thresholds: - - - closedLoopControlName: "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e" - version: "1.0.2" - fieldPath: "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value" - thresholdValue: 0 - direction: EQUAL - severity: MAJOR - closedLoopEventStatus: ABATED - - - closedLoopControlName: "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e" - version: "1.0.2" - fieldPath: "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value" - thresholdValue: 0 - direction: GREATER - severity: CRITICAL - closedLoopEventStatus: ONSET
\ No newline at end of file |