Open Kilda Java Documentation
org.openkilda.northbound.controller.SwitchController Class Reference

Public Member Functions

List< SwitchDtogetSwitches ()
 
SwitchFlowEntries getSwitchRules ( @PathVariable("switch-id") SwitchId switchId, @ApiParam(value="Results will be filtered based on matching the cookie.", required=false) @RequestParam(value="cookie", required=false) Optional< Long > cookie)
 
ResponseEntity< List< Long > > deleteSwitchRules ( @PathVariable("switch-id") SwitchId switchId, @ApiParam(value="default: IGNORE_DEFAULTS. Can be one of DeleteRulesAction: "+"DROP_ALL,DROP_ALL_ADD_DEFAULTS,IGNORE_DEFAULTS,OVERWRITE_DEFAULTS,"+"REMOVE_DROP,REMOVE_BROADCAST,REMOVE_UNICAST,REMOVE_DEFAULTS,REMOVE_ADD_DEFAULTS", required=false) @RequestParam(value="delete-action", required=false) Optional< DeleteRulesAction > deleteAction, @RequestParam(value="cookie", required=false) Optional< Long > cookie, @RequestParam(value="in-port", required=false) Optional< Integer > inPort, @RequestParam(value="in-vlan", required=false) Optional< Integer > inVlan, @RequestParam(value="priority", required=false) Optional< Integer > priority, @RequestParam(value="out-port", required=false) Optional< Integer > outPort)
 
ResponseEntity< List< Long > > installSwitchRules ( @PathVariable("switch-id") SwitchId switchId, @ApiParam(value="default: INSTALL_DEFAULTS. Can be one of InstallRulesAction: "+" INSTALL_DROP,INSTALL_BROADCAST,INSTALL_UNICAST,INSTALL_DEFAULTS", required=false) @RequestParam(value="install-action", required=false) Optional< InstallRulesAction > installAction)
 
ResponseEntity< ConnectModeRequest.Mode > toggleSwitchConnectMode ( @RequestParam("mode") ConnectModeRequest.Mode mode)
 
RulesValidationResult validateRules (@PathVariable(name="switch_id") SwitchId switchId)
 
RulesSyncResult syncRules (@PathVariable(name="switch_id") SwitchId switchId)
 
DeleteMeterResult deleteMeter (@PathVariable(name="switch_id") SwitchId switchId, @PathVariable(name="meter_id") long meterId)
 
PortDto configurePort ( @PathVariable(name="switch_id") SwitchId switchId, @PathVariable(name="port_no") int portNo, @RequestBody PortConfigurationPayload portConfig)
 

Detailed Description

REST Controller for switches.

Definition at line 77 of file SwitchController.java.

Member Function Documentation

◆ configurePort()

PortDto org.openkilda.northbound.controller.SwitchController.configurePort ( @PathVariable(name="switch_id") SwitchId  switchId,
@PathVariable(name="port_no") int  portNo,
@RequestBody PortConfigurationPayload  portConfig 
)

Configure port.

Parameters
switchIdthe switch id
portNothe port no
portConfigthe port configuration payload
Returns
the response entity

Definition at line 271 of file SwitchController.java.

◆ deleteMeter()

DeleteMeterResult org.openkilda.northbound.controller.SwitchController.deleteMeter ( @PathVariable(name="switch_id") SwitchId  switchId,
@PathVariable(name="meter_id") long  meterId 
)

Remove the meter from specific switch.

Parameters
switchIdswitch dpid.
meterIdid of the meter to be deleted.
Returns
result of the operation wrapped into DeleteMeterResult. True means no errors is occurred.

Definition at line 254 of file SwitchController.java.

◆ deleteSwitchRules()

ResponseEntity<List<Long> > org.openkilda.northbound.controller.SwitchController.deleteSwitchRules ( @PathVariable("switch-id") SwitchId  switchId,
@ApiParam(value="default: IGNORE_DEFAULTS. Can be one of DeleteRulesAction: "+"DROP_ALL,DROP_ALL_ADD_DEFAULTS,IGNORE_DEFAULTS,OVERWRITE_DEFAULTS,"+"REMOVE_DROP,REMOVE_BROADCAST,REMOVE_UNICAST,REMOVE_DEFAULTS,REMOVE_ADD_DEFAULTS", required=false) @RequestParam(value="delete-action", required=false) Optional< DeleteRulesAction deleteAction,
@RequestParam(value="cookie", required=false) Optional< Long >  cookie,
@RequestParam(value="in-port", required=false) Optional< Integer >  inPort,
@RequestParam(value="in-vlan", required=false) Optional< Integer >  inVlan,
@RequestParam(value="priority", required=false) Optional< Integer >  priority,
@RequestParam(value="out-port", required=false) Optional< Integer >  outPort 
)

Delete switch rules.

Parameters
switchIdswitch id to delete rules from
deleteActiondefines what to do about the default rules
cookiethe cookie to use if deleting a rule (could be any rule)
inPortthe in port to use if deleting a rule
inVlanthe in vlan to use if deleting a rule
outPortthe out port to use if deleting a rule
Returns
list of the cookies of the rules that have been deleted

Definition at line 134 of file SwitchController.java.

◆ getSwitches()

List<SwitchDto> org.openkilda.northbound.controller.SwitchController.getSwitches ( )

Get all available links.

Returns
list of links.

Definition at line 92 of file SwitchController.java.

◆ getSwitchRules()

SwitchFlowEntries org.openkilda.northbound.controller.SwitchController.getSwitchRules ( @PathVariable("switch-id") SwitchId  switchId,
@ApiParam(value="Results will be filtered based on matching the cookie.", required=false) @RequestParam(value="cookie", required=false) Optional< Long >  cookie 
)

Get switch rules.

Parameters
switchIdthe switch
cookiefilter the response based on this cookie
Returns
list of the cookies of the rules that have been deleted

Definition at line 107 of file SwitchController.java.

◆ installSwitchRules()

ResponseEntity<List<Long> > org.openkilda.northbound.controller.SwitchController.installSwitchRules ( @PathVariable("switch-id") SwitchId  switchId,
@ApiParam(value="default: INSTALL_DEFAULTS. Can be one of InstallRulesAction: "+" INSTALL_DROP,INSTALL_BROADCAST,INSTALL_UNICAST,INSTALL_DEFAULTS", required=false) @RequestParam(value="install-action", required=false) Optional< InstallRulesAction installAction 
)

Install switch rules.

Parameters
switchIdswitch id to delete rules from
installActiondefines what to do about the default rules
Returns
list of the cookies of the rules that have been installed

Definition at line 188 of file SwitchController.java.

◆ syncRules()

RulesSyncResult org.openkilda.northbound.controller.SwitchController.syncRules ( @PathVariable(name="switch_id") SwitchId  switchId)

Synchronize (install) missing flows that should be on the switch but exist only in neo4j.

Returns
the synchronization result.

Definition at line 241 of file SwitchController.java.

◆ toggleSwitchConnectMode()

ResponseEntity<ConnectModeRequest.Mode> org.openkilda.northbound.controller.SwitchController.toggleSwitchConnectMode ( @RequestParam("mode") ConnectModeRequest.Mode  mode)

Toggle the global behavior of Floodlight when the switch connects:

  • AUTO - this is the default. Installs all default rules when a switch connects
  • SAFE - add the default rules slowly .. monitoring traffic on existing rules
  • MANUAL - don't install any default rules. Call addRule for that. NOTE: no action is taking with existing, connected switches. This operation will only affect future connections
Parameters
modethe connectMode to use. A Null value is a No-Op and can be used to return existing value.
Returns
the value of the toggle in Floodlight.

Definition at line 215 of file SwitchController.java.

◆ validateRules()

RulesValidationResult org.openkilda.northbound.controller.SwitchController.validateRules ( @PathVariable(name="switch_id") SwitchId  switchId)

Validate the rules installed on the switch against the flows in Neo4J.

Returns
the validation details.

Definition at line 229 of file SwitchController.java.


The documentation for this class was generated from the following file: