@Override public Row<GenericTableSchema> insertTree(Node node, String databaseName, String tableName, String parentTable, UUID parentUuid, String parentColumn, Row<GenericTableSchema> row) throws OvsdbPluginException { return pluginOvsdbConfigurationService .insertTree(NodeUtils.getMdsalNode(node), databaseName, tableName, parentTable, parentUuid, parentColumn, row); }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response createRow(InputStream stream) throws IOException { OvsdbRow localRow = this.getOvsdbRow(stream); if (localRow == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } OvsdbConfigurationService ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class, this); if (ovsdbTable == null) { throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString()); } Node node = NodeResource.getOvsdbNode(nodeId, this); Row row = ovsdbTable.insertTree(node, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName, localRow.getParentTable(), new UUID(localRow.getParentUuid()), localRow.getParentColumn(), localRow.getRow()); String response = objectMapper.writeValueAsString(row); return Response.status(Response.Status.CREATED) .entity(response) .build(); }