public class SubnetsNorthbound extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SubnetsNorthbound() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
addSubnet(String containerName,
String subnetName,
org.opendaylight.controller.switchmanager.SubnetConfig subnetConfigData)
Add a subnet into the specified container context, node connectors are
optional
|
protected String |
getUserName() |
org.opendaylight.controller.switchmanager.SubnetConfig |
listSubnet(String containerName,
String subnetName)
List the configuration of a subnet in a given container
|
SubnetConfigs |
listSubnets(String containerName)
List all the subnets in a given container
|
javax.ws.rs.core.Response |
modifySubnet(javax.ws.rs.core.UriInfo uriInfo,
String containerName,
String subnetName,
org.opendaylight.controller.switchmanager.SubnetConfig subnetConfigData)
Modify a subnet.
|
javax.ws.rs.core.Response |
removeSubnet(String containerName,
String subnetName)
Delete a subnet from the specified container context
|
void |
setSecurityContext(javax.ws.rs.core.SecurityContext context) |
@Context public void setSecurityContext(javax.ws.rs.core.SecurityContext context)
protected String getUserName()
public SubnetConfigs listSubnets(String containerName)
containerName - container in which we want to query the subnets
Example:
Request URL:
http://localhost:8080/controller/nb/v2/subnetservice/default/subnets
Response body in XML:
<list>
<subnetConfig>
<name>marketingdepartment</name>
<subnet>30.31.54.254/24</subnet>
</subnetConfig>
<subnetConfig>
<name>salesdepartment</name>
<subnet>20.18.1.254/16</subnet>
<nodeConnectors>OF|11@OF|00:00:00:aa:bb:cc:dd:ee</nodeConnectors>
<nodeConnectors>OF|13@OF|00:00:00:aa:bb:cc:dd:ee</nodeConnectors>
</subnetConfig>
</list>
Response body in JSON:
{
"subnetConfig": [
{
"name": "marketingdepartment",
"subnet": "30.31.54.254/24",
"nodeConnectors": [
"OF|04@OF|00:00:00:00:00:00:00:04",
"OF|07@OF|00:00:00:00:00:00:00:07"
]
},
{
"name":"salesdepartment",
"subnet":"20.18.1.254/16",
"nodeConnectors": [
"OF|11@OF|00:00:00:aa:bb:cc:dd:ee",
"OF|13@OF|00:00:00:aa:bb:cc:dd:ee"
]
}
]
}
public org.opendaylight.controller.switchmanager.SubnetConfig listSubnet(String containerName, String subnetName)
containerName - container in which we want to query the subnetsubnetName - of the subnet being queried
Example:
Request URL:
http://localhost:8080/controller/nb/v2/subnetservice/default/subnet/marketingdepartment
Response body in XML:
<subnetConfig>
<name>marketingdepartment</name>
<subnet>30.0.0.1/24</subnet>
<nodeConnectors>OF|1@OF|00:00:00:00:00:00:00:01</nodePorts>
<nodeConnectors>OF|3@OF|00:00:00:00:00:00:00:03</nodePorts>
</subnetConfig>
Response body in JSON:
{
"name":"marketingdepartment",
"subnet":"30.0.0.1/24",
"nodeConnectors":[
"OF|1@OF|00:00:00:00:00:00:00:01",
"OF|3@OF|00:00:00:00:00:00:00:03"
]
}
public javax.ws.rs.core.Response addSubnet(String containerName, String subnetName, org.opendaylight.controller.switchmanager.SubnetConfig subnetConfigData)
containerName - name of the container context in which the subnet needs to be
addedsubnetName - name of new subnet to be addedsubnetConfigData - the SubnetConfig structure in request body
Example:
Request URL:
http://localhost:8080/controller/nb/v2/subnetservice/default/subnet/salesdepartment
Request body in XML:
<subnetConfig>
<name>salesdepartment</name>
<subnet>172.173.174.254/24</subnet>
<nodeConnectors>OF|22@OF|00:00:11:22:33:44:55:66</nodeConnectors>
<nodeConnectors>OF|39@OF|00:00:ab:cd:33:44:55:66</nodeConnectors>
</subnetConfig>
Request body in JSON:
{
"name":"salesdepartment",
"subnet":"172.173.174.254/24",
"nodeConnectors":[
"OF|22@OF|00:00:11:22:33:44:55:66",
"OF|39@OF|00:00:ab:cd:33:44:55:66"
]
}
public javax.ws.rs.core.Response removeSubnet(String containerName, String subnetName)
containerName - name of the container in which subnet needs to be removedsubnetName - name of new subnet to be deletedExample: Request URL: http://localhost:8080/controller/nb/v2/subnetservice/default/subnet/engdepartment
public javax.ws.rs.core.Response modifySubnet(@Context
javax.ws.rs.core.UriInfo uriInfo,
String containerName,
String subnetName,
org.opendaylight.controller.switchmanager.SubnetConfig subnetConfigData)
containerName - Name of the Container contextsubnetName - Name of the subnet to be modifiedsubnetConfigData - the SubnetConfig structure in request body parameter
Example:
Request URL:
http://localhost:8080/controller/nb/v2/subnetservice/default/subnet/salesdepartment
Request body in XML:
<subnetConfig>
<name>salesdepartment</name>
<subnet>172.173.174.254/24</subnet>
<nodeConnectors>OF|22@OF|00:00:11:22:33:44:55:66</nodeConnectors>
<nodeConnectors>OF|39@OF|00:00:ab:cd:33:44:55:66</nodeConnectors>
</subnetConfig>
Request body in JSON:
{
"name":"salesdepartment",
"subnet":"172.173.174.254/24",
"nodeConnectors":[
"OF|22@OF|00:00:11:22:33:44:55:66",
"OF|39@OF|00:00:ab:cd:33:44:55:66"
]
}
Copyright © 2014. All Rights Reserved.