@Path(value="subnets")
public class SubnetWebResource
extends org.onosproject.rest.AbstractWebResource
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_NOT_NULL |
static String |
SUBNET_NOT_CREATED |
static String |
SUBNET_NOT_FOUND |
| Constructor and Description |
|---|
SubnetWebResource() |
| Modifier and Type | Method and Description |
|---|---|
Iterable<Subnet> |
changeJsonToSub(com.fasterxml.jackson.databind.JsonNode subnetNodes)
Returns a collection of subnets from subnetNodes.
|
Iterable<Subnet> |
changeJsonToSubs(com.fasterxml.jackson.databind.JsonNode subnetNodes)
Returns a collection of subnets from subnetNodes.
|
javax.ws.rs.core.Response |
createSubnet(InputStream input) |
javax.ws.rs.core.Response |
deleteSingleSubnet(String id) |
javax.ws.rs.core.Response |
getSubnet(String id) |
Iterable<AllocationPool> |
jsonNodeToAllocationPools(com.fasterxml.jackson.databind.JsonNode allocationPools)
Changes JsonNode alocPools to a collection of the alocPools.
|
Iterable<HostRoute> |
jsonNodeToHostRoutes(com.fasterxml.jackson.databind.JsonNode hostRoutes)
Changes hostRoutes JsonNode to a collection of the hostRoutes.
|
javax.ws.rs.core.Response |
listSubnets() |
protected <T> T |
nullIsNotFound(T item,
String message)
Returns the specified item if that items is null; otherwise throws not
found exception.
|
javax.ws.rs.core.Response |
updateSubnet(String id,
InputStream input) |
codec, encodeArray, getService, mapper, newArray, newObjectget, ok, setServiceDirectorypublic static final String SUBNET_NOT_CREATED
public static final String SUBNET_NOT_FOUND
public static final String JSON_NOT_NULL
@GET @Produces(value="application/json") @Consumes(value="application/json") public javax.ws.rs.core.Response listSubnets()
@GET
@Path(value="{subnetUUID}")
@Produces(value="application/json")
@Consumes(value="application/json")
public javax.ws.rs.core.Response getSubnet(@PathParam(value="subnetUUID")
String id)
@POST @Produces(value="application/json") @Consumes(value="application/json") public javax.ws.rs.core.Response createSubnet(InputStream input)
@PUT
@Path(value="{subnetUUID}")
@Produces(value="application/json")
@Consumes(value="application/json")
public javax.ws.rs.core.Response updateSubnet(@PathParam(value="id")
String id,
InputStream input)
@DELETE
@Path(value="{subnetUUID}")
@Consumes(value="application/json")
@Produces(value="application/json")
public javax.ws.rs.core.Response deleteSingleSubnet(@PathParam(value="subnetUUID")
String id)
throws IOException
IOExceptionpublic Iterable<Subnet> changeJsonToSubs(com.fasterxml.jackson.databind.JsonNode subnetNodes)
subnetNodes - the subnet json nodepublic Iterable<Subnet> changeJsonToSub(com.fasterxml.jackson.databind.JsonNode subnetNodes)
subnetNodes - the subnet json nodepublic Iterable<AllocationPool> jsonNodeToAllocationPools(com.fasterxml.jackson.databind.JsonNode allocationPools)
allocationPools - the allocationPools JsonNodepublic Iterable<HostRoute> jsonNodeToHostRoutes(com.fasterxml.jackson.databind.JsonNode hostRoutes)
hostRoutes - the hostRoutes json nodeprotected <T> T nullIsNotFound(T item,
String message)
T - item typeitem - item to checkmessage - not found messageorg.onlab.util.ItemNotFoundException - if item is null