Software Defined Networking
1828330 Members
4723 Online
109976 Solutions
New Discussion

Re: Setting port state in REST API?

 
stacehip
Occasional Contributor

Setting port state in REST API?

looking at the documentation I can see I can enable or disable a port using /of/datapaths/{dpid}/ports/{port_id}/action and RSdoc gives a working example. Unfortunatly when you disable a port you lose the link so the topology changes. I just want to stop traffic flowing over the port. I know I could do this with a flow but setting the state would be easier.

Can anyone point me to how to set the state? From the object model i can see there are 7 possible states but i can find how to change them (see below).

"state": {
"description": "Port states",
"type": "array",
"items": {
"enum": ["link_down",
"blocked",
"live",
"stp_listen",
"stp_learn",
"stp_forward",
"stp_block"]
}
}

2 REPLIES 2
sdnindia
Trusted Contributor

Re: Setting port state in REST API?

Hello stacehip,

 

According to version 2.0.0 of the sdn-apidoc, PortState (com.hp.of.lib.msg) is “read-only and cannot be changed by the controller.”  So it’s not possible to set a port to link_down, blocked, live, etc.

All port flags are read-only and when the port flags are changed, the switch sends a {@link MessageType#PORT_STATUS } message to notify the controller of the change.

So we cannot set the port states through the controller.

 

Hope this answers your query, please feel free to reply if you have any addition queries related to this topic.

 

Thanks,

HP SDN Team

sdnindia
Trusted Contributor

Re: Setting port state in REST API?

Hello stacehip,

 

Doing a follow up to check if you need any further assistance with respect to the query posted.

Please do let us know  if your problem is solved.

 

If you have more questions on the same topic please do reply on the same thread or open a new post if new topic.

 

Thanks

HP SDN Team