openstack.identity.user = jbalasub
openstack.identity.password = OBF:1thj1vn01v1p1toq1to41v2p1vo21th3
-openstack.types = vserver, l3-network
+openstack.types = vserver, l3-network, port
openstack.type.vserver.url = http://10.69.100.11:8774/v2.1/servers/{0}
openstack.type.l3-network.url = http://10.69.100.11:9696/v2.0/networks/{0}
+openstack.type.port.url = http://10.69.100.11:9696/v2.0/ports/{0}
openstack.api.microversion = 2.42
"network": {
"id": "id",
"name": "name",
- "admin_state_up": "tempList[].adminState",
+ "admin_state_up": "tempList[].adminStateUp",
"shared": "tempList[].sharedNetwork",
"status": "tempList[].status",
"subnets" : {
--- /dev/null
+[
+ {
+ "operation": "shift",
+ "spec": {
+ "port": {
+ "id": "id",
+ "name": "name",
+ "admin_state_up": "tempList[].adminStateUp",
+ "mac_address" : "tempList[].macAddress"
+ }
+ }
+ },
+ {
+ "operation": "shift",
+ "spec": {
+ "tempList": {
+ "*": {
+ "*" : {
+ "$": "attributeList[#3].name",
+ "@": "attributeList[#3].value"
+ },
+ "#ok": "attributeList[#2].dataQuality.status"
+ }
+ },
+ "*": {
+ "@" : "&"
+ },
+ "#port": "type",
+ "#ok": "dataQuality.status"
+ }
+ }
+
+]
\ No newline at end of file
JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(resourceInstJson)));\r
\r
}\r
+ \r
+ @Test\r
+ public void testTransformPort() {\r
+\r
+ Object sourceObject = JsonUtils.filepathToObject(TEST_RESOURCES + "port-input.json");\r
+ String resultJson = TransformationUtil.transform(JsonUtils.toJsonString(sourceObject), "port");\r
+\r
+ Gson gson = new Gson();\r
+ Resource resourceInst = gson.fromJson(resultJson, Resource.class);\r
+ String resourceInstJson = gson.toJson(resourceInst);\r
+\r
+ Object expectedObject = JsonUtils.filepathToObject(TEST_RESOURCES + "port-expected.json");\r
+\r
+ Assert.assertEquals("Json transformation result does not match expected content",\r
+ JsonUtils.toPrettyJsonString(expectedObject),\r
+ JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(resourceInstJson)));\r
+\r
+ }\r
\r
@Test\r
public void testTransformFailureFileNotFound() {\r
"status" : "ok"\r
},\r
"attributeList" : [ {\r
- "name" : "adminState",\r
+ "name" : "adminStateUp",\r
"value" : "true",\r
"dataQuality" : {\r
"status" : "ok"\r
--- /dev/null
+{\r
+ "id" : "bcd87883-c92f-4f2b-b5bf-1288948facdd",\r
+ "name" : "bcd8",\r
+ "type" : "port",\r
+ "dataQuality" : {\r
+ "status" : "ok"\r
+ },\r
+ "attributeList" : [ {\r
+ "name" : "adminStateUp",\r
+ "value" : "true",\r
+ "dataQuality" : {\r
+ "status" : "ok"\r
+ }\r
+ }, {\r
+ "name" : "macAddress",\r
+ "value" : "fa:16:3e:ff:f7:af",\r
+ "dataQuality" : {\r
+ "status" : "ok"\r
+ }\r
+ } ]\r
+}
\ No newline at end of file
--- /dev/null
+{
+ "port": {
+ "status": "ACTIVE",
+ "binding:host_id": "Setup-D2-OTT-A-Master",
+ "description": "",
+ "allowed_address_pairs": [],
+ "tags": [],
+ "extra_dhcp_opts": [],
+ "updated_at": "2019-02-07T21:11:17Z",
+ "device_owner": "compute:nova",
+ "revision_number": 9,
+ "binding:profile": {},
+ "fixed_ips": [
+ {
+ "subnet_id": "b3684cd7-43ee-4aa3-9266-8c66f87d10a3",
+ "ip_address": "10.69.102.6"
+ }
+ ],
+ "id": "bcd87883-c92f-4f2b-b5bf-1288948facdd",
+ "security_groups": [
+ "6e0243dc-5040-491a-b54e-55b88cd01855"
+ ],
+ "device_id": "645a12dc-09b5-45cb-8ab1-a0ce41b7200a",
+ "name": "bcd8",
+ "admin_state_up": true,
+ "network_id": "2ea02809-7279-4b5e-931a-62b231615497",
+ "tenant_id": "1130b349e19c4827bf91a29d51256af1",
+ "binding:vif_details": {
+ "port_filter": true,
+ "ovs_hybrid_plug": true
+ },
+ "binding:vnic_type": "normal",
+ "binding:vif_type": "ovs",
+ "mac_address": "fa:16:3e:ff:f7:af",
+ "project_id": "1130b349e19c4827bf91a29d51256af1",
+ "created_at": "2018-12-04T20:40:58Z"
+ }
+}
\ No newline at end of file