summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/resources/registration_to_simulator/environment/deactivate/get_operational_environments_aai1.json
blob: 8d6cd4ad7d1c798109c9224b8372b67354bd812e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  "simulatorRequest": {
    "method": "GET",
    "path": "/aai/v../cloud-infrastructure/operational-environments"
  } ,
  "simulatorResponse": {
    "responseCode": 200,
    "body": {
      "operational-environment":[{
        "operational-environment-id": "f07ca256-96dd-40ad-b4d2-7a77e2a974ea",
        "operational-environment-name": "Op Env Name",
        "operational-environment-type": "VNF",
        "operational-environment-status": "Activate",
        "tenant-context": "Test",
        "workload-context": "VNF_Development",
        "resource-version": "1505228226913",
        "relationship-list": {
        "relationship":[
          {
            "related-to": "operational-environment",
            "related-link": "string",
            "relationship-data": [
              {
                "relationship-key": "operational-environment.operational-environment-id",
                "relationship-value": "UUID of the ECOMP Operational Environment"
              }
            ],
            "related-to-property": [
              {
                "property-key": "operational-environment.operational-environment-name",
                "property-value": "Name of the ECOMP Operational Environment"
              }
            ]
          }
        ]
        }
      },
      {
        "operational-environment-id": "f07ca256-96dd-40ad-b4d2-7a77e2a974eb",
        "operational-environment-name": "Op Env Name",
        "operational-environment-type": "VNF",
        "operational-environment-status": "Deactivate",
        "tenant-context": "Test",
        "workload-context": "VNF_Development",
        "resource-version": "1505228226913",
        "relationship-list": {
        "relationship":[
          {
            "related-to": "operational-environment",
            "related-link": "string",
            "relationship-data": [
              {
                "relationship-key": "operational-environment.operational-environment-id",
                "relationship-value": "UUID of the ECOMP Operational Environment"
              }
            ],
            "related-to-property": [
              {
                "property-key": "operational-environment.operational-environment-name",
                "property-value": "Name of the ECOMP Operational Environment"
              }
            ]
          }
        ]
        }
      },
      {
        "operational-environment-id": "f07ca256-96dd-40ad-b4d2-7a77e2a974ec",
        "operational-environment-name": "ECOMP Env Name",
        "operational-environment-type": "ONAP",
        "operational-environment-status": "Deactivate",
        "tenant-context": "ECOMP Test",
        "workload-context": "ECOMP_Development",
        "resource-version": "1505228226912"
      },
      {
        "operational-environment-id": "f07ca256-96dd-40ad-b4d2-7a77e2a974ed",
        "operational-environment-name": "ECOMP Env Name",
        "operational-environment-type": "ONAP",
        "operational-environment-status": "Activate",
        "tenant-context": "ECOMP Test",
        "workload-context": "ECOMP_Development",
        "resource-version": "1505228226912"
      }
    ]}
  }
}
pan> "pserver", query.getResultType()); } /** * Child query. * * @throws JAXBException the JAXB exception * @throws UnsupportedEncodingException the unsupported encoding exception * @throws AAIException the AAI exception */ @Test public void childQuery() throws JAXBException, UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("cloud-infrastructure/pservers/pserver/key1/lag-interfaces/lag-interface/key2").build(); QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); String expected = ".has('hostname', 'key1').has('aai-node-type', 'pserver')" + ".out('hasLAGInterface').has('aai-node-type', 'lag-interface')" + ".has('interface-name', 'key2')"; String parentExpected = ".has('hostname', 'key1').has('aai-node-type', 'pserver')"; assertEquals( "gremlin query should be for node", expected, query.getQueryBuilder().getQuery()); assertEquals( "parent gremlin query should be for parent", parentExpected, query.getQueryBuilder().getParentQuery().getQuery()); assertEquals( "result type should be lag-interface", "lag-interface", query.getResultType()); } /** * Naming exceptions. * * @throws JAXBException the JAXB exception * @throws UnsupportedEncodingException the unsupported encoding exception * @throws AAIException the AAI exception */ @Test public void namingExceptions() throws JAXBException, UnsupportedEncodingException, AAIException { URI uri = UriBuilder.fromPath("network/vces/vce/key1/port-groups/port-group/key2/cvlan-tags/cvlan-tag/655").build(); QueryParser query = dbEngine.getQueryBuilder().createQueryFromURI(uri); String expected = ".has('vnf-id', 'key1').has('aai-node-type', 'vce')" + ".in('org.onap.relationships.inventory.BelongsTo').has('aai-node-type', 'port-group')" + ".has('interface-id', 'key2')" + ".in('org.onap.relationships.inventory.BelongsTo').has('aai-node-type', 'cvlan-tag')" + ".has('cvlan-tag', 655)"; String expectedParent = ".has('vnf-id', 'key1').has('aai-node-type', 'vce')" + ".in('org.onap.relationships.inventory.BelongsTo').has('aai-node-type', 'port-group')" + ".has('interface-id', 'key2')"; assertEquals( "gremlin query should be " + expected, expected, query.getQueryBuilder().getQuery()); assertEquals( "parent gremlin query should be equal the query for port group", expectedParent, query.getQueryBuilder().getParentQuery().getQuery()); assertEquals( "result type should be cvlan-tag", "cvlan-tag", query.getResultType()); } }