* ============LICENSE_START=======================================================
* simulators
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@Path("/v8/network/generic-vnfs/generic-vnf/{vnfId}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public String aaiGetQuery(@PathParam("vnfID") final String vnfId) {
+ public String aaiGetQuery(@PathParam("vnfId") final String vnfId) {
return "{\"relationship-list\": {\"relationship\":[{\"related-to-property\": [{\"property-key\": "
+ "\"service-instance.service-instance-name\"}]},{\"related-to-property\": [ {\"property-key\": "
+ "\"vserver.vserver-name\",\"property-value\": \"USUCP0PCOIL0110UJZZ01-vsrx\" }]} ]}}";
StandardCharsets.UTF_8);
}
+ /**
+ * A&AI get PNF query.
+ *
+ * @return the result
+ * @throws IOException if a response file cannot be read
+ */
+ @GET
+ @Path("/v16/network/pnfs/pnf/{pnfName}")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces("application/json")
+ public String aaiGetPnfQuery(@PathParam("pnfName") final String pnfName) throws IOException {
+ if (GETFAIL.equals(pnfName)) {
+ throw new IllegalArgumentException("query failed, as requested");
+ }
+
+ return IOUtils.toString(getClass().getResource("aai/AaiGetPnfResponse.json"),
+ StandardCharsets.UTF_8);
+ }
+
/**
* Get by VNF name.
*