Open Kilda Java Documentation
org.openkilda.flow.FlowUtils Class Reference

Static Public Member Functions

static Client clientFactory ()
 
static int getHealthCheck ()
 
static FlowPayload getFlow (final String flowId)
 
static FlowPayload putFlow (final FlowPayload payload)
 
static FlowPayload updateFlow (final String flowId, final FlowPayload payload)
 
static FlowPayload deleteFlow (final String flowId)
 
static FlowPathPayload getFlowPath (final String flowId)
 
static ImmutablePair< PathInfoData, PathInfoDatagetFlowPath (Flow flow) throws InterruptedException, UnroutablePathException, RecoverableException
 
static FlowIdStatusPayload waitFlowStatus (String flowName, FlowState expected) throws InterruptedException
 
static void waitFlowDeletion (String flowId) throws InterruptedException, FlowOperationException
 
static FlowIdStatusPayload getFlowStatus (final String flowId)
 
static List< FlowPayloadgetFlowDump ()
 
static List< FlowdumpFlows ()
 
static Integer getLinkBandwidth (final SwitchId srcSwitch, final String srcPort)
 
static void restoreFlows ()
 
static void cleanupFlows ()
 
static String getFlowName (final String flowId)
 
static double getTimeDuration (final long current)
 
static boolean isTrafficTestsEnabled ()
 
static FeatureTogglePayload updateFeaturesStatus (FeatureTogglePayload desired)
 
static FlowCacheSyncResults syncFlowCache ()
 
static FlowCacheSyncResults invalidateFlowCache ()
 
static boolean deleteFlowViaTe (final String flowId)
 
static List< FlowValidationDtovalidateFlow (final String flowId)
 
static BatchResults pushFlow (FlowInfoData flowInfo, boolean propagate) throws JsonProcessingException
 
static VerificationOutput verifyFlow (String flowId, VerificationInput payload)
 

Detailed Description

Definition at line 74 of file FlowUtils.java.

Member Function Documentation

◆ cleanupFlows()

static void org.openkilda.flow.FlowUtils.cleanupFlows ( )
static

Cleanups all flows.

Definition at line 531 of file FlowUtils.java.

◆ clientFactory()

static Client org.openkilda.flow.FlowUtils.clientFactory ( )
static

Definition at line 84 of file FlowUtils.java.

◆ deleteFlow()

static FlowPayload org.openkilda.flow.FlowUtils.deleteFlow ( final String  flowId)
static

Deletes flow through Northbound service.

Parameters
flowIdflow id
Returns
The JSON document of the specified flow

Definition at line 238 of file FlowUtils.java.

◆ deleteFlowViaTe()

static boolean org.openkilda.flow.FlowUtils.deleteFlowViaTe ( final String  flowId)
static

Deletes flow through TopologyEngine service.

Definition at line 720 of file FlowUtils.java.

◆ dumpFlows()

static List<Flow> org.openkilda.flow.FlowUtils.dumpFlows ( )
static

Returns flows through Topology-Engine-Rest service.

Returns
The JSON document of all flows

Definition at line 444 of file FlowUtils.java.

◆ getFlow()

static FlowPayload org.openkilda.flow.FlowUtils.getFlow ( final String  flowId)
static

Gets flow through Northbound service.

Parameters
flowIdflow id
Returns
The JSON document of the specified flow

Definition at line 126 of file FlowUtils.java.

◆ getFlowDump()

static List<FlowPayload> org.openkilda.flow.FlowUtils.getFlowDump ( )
static

Gets flows dump through Northbound service.

Returns
The JSON document of the dump flows

Definition at line 409 of file FlowUtils.java.

◆ getFlowName()

static String org.openkilda.flow.FlowUtils.getFlowName ( final String  flowId)
static

Builds flow name by flow id.

Parameters
flowIdflow id
Returns
flow name

Definition at line 595 of file FlowUtils.java.

◆ getFlowPath() [1/2]

static FlowPathPayload org.openkilda.flow.FlowUtils.getFlowPath ( final String  flowId)
static

Gets flow path through Northbound service.

Parameters
flowIdflow id
Returns
The JSON document of the specified flow path

Definition at line 275 of file FlowUtils.java.

◆ getFlowPath() [2/2]

static ImmutablePair<PathInfoData, PathInfoData> org.openkilda.flow.FlowUtils.getFlowPath ( Flow  flow) throws InterruptedException, UnroutablePathException, RecoverableException
static

Fetch flow's path directly from PathComputer.

Parameters
flowflow
Returns
flow path

Definition at line 311 of file FlowUtils.java.

◆ getFlowStatus()

static FlowIdStatusPayload org.openkilda.flow.FlowUtils.getFlowStatus ( final String  flowId)
static

Gets flow status through Northbound service.

Parameters
flowIdflow id
Returns
The JSON document of the specified flow status

Definition at line 367 of file FlowUtils.java.

◆ getHealthCheck()

static int org.openkilda.flow.FlowUtils.getHealthCheck ( )
static

Method getHealthCheck.

Definition at line 91 of file FlowUtils.java.

◆ getLinkBandwidth()

static Integer org.openkilda.flow.FlowUtils.getLinkBandwidth ( final SwitchId  srcSwitch,
final String  srcPort 
)
static

Returns link available bandwidth through Topology-Engine-Rest service.

Returns
The JSON document of all flows

Definition at line 478 of file FlowUtils.java.

◆ getTimeDuration()

static double org.openkilda.flow.FlowUtils.getTimeDuration ( final long  current)
static

Returns timestamp difference.

Parameters
currentcurrent timestamp
Returns
timestamp difference

Definition at line 605 of file FlowUtils.java.

◆ invalidateFlowCache()

static FlowCacheSyncResults org.openkilda.flow.FlowUtils.invalidateFlowCache ( )
static

Perform the flow cache invalidation (via Northbound service).

Definition at line 691 of file FlowUtils.java.

◆ isTrafficTestsEnabled()

static boolean org.openkilda.flow.FlowUtils.isTrafficTestsEnabled ( )
static

Method isTrafficTestsEnabled.

Definition at line 612 of file FlowUtils.java.

◆ pushFlow()

static BatchResults org.openkilda.flow.FlowUtils.pushFlow ( FlowInfoData  flowInfo,
boolean  propagate 
) throws JsonProcessingException
static

Push a flow through Northbound service.

Parameters
flowInfothe flow definition
propagatewhether propagate data to switches or not
Returns
the result of the push operation

Definition at line 786 of file FlowUtils.java.

◆ putFlow()

static FlowPayload org.openkilda.flow.FlowUtils.putFlow ( final FlowPayload  payload)
static

Creates flow through Northbound service.

Parameters
payloadflow JSON data
Returns
The JSON document of the created flow

Definition at line 163 of file FlowUtils.java.

◆ restoreFlows()

static void org.openkilda.flow.FlowUtils.restoreFlows ( )
static

Method restoreFlows.

Definition at line 511 of file FlowUtils.java.

◆ syncFlowCache()

static FlowCacheSyncResults org.openkilda.flow.FlowUtils.syncFlowCache ( )
static

Perform the flow cache synchronization (via Northbound service).

Definition at line 660 of file FlowUtils.java.

◆ updateFeaturesStatus()

static FeatureTogglePayload org.openkilda.flow.FlowUtils.updateFeaturesStatus ( FeatureTogglePayload  desired)
static

Method updateFeaturesStatus.

Definition at line 621 of file FlowUtils.java.

◆ updateFlow()

static FlowPayload org.openkilda.flow.FlowUtils.updateFlow ( final String  flowId,
final FlowPayload  payload 
)
static

Updates flow through Northbound service.

Parameters
flowIdflow id
payloadflow JSON data
Returns
The JSON document of the created flow

Definition at line 200 of file FlowUtils.java.

◆ validateFlow()

static List<FlowValidationDto> org.openkilda.flow.FlowUtils.validateFlow ( final String  flowId)
static

Validate the flow path and rules (e.g. whether properly installed).

Definition at line 750 of file FlowUtils.java.

◆ verifyFlow()

static VerificationOutput org.openkilda.flow.FlowUtils.verifyFlow ( String  flowId,
VerificationInput  payload 
)
static

Method verifyFlow.

Definition at line 827 of file FlowUtils.java.

◆ waitFlowDeletion()

static void org.openkilda.flow.FlowUtils.waitFlowDeletion ( String  flowId) throws InterruptedException, FlowOperationException
static

call doGetFlowStatusRequest until it got success codes 2xx. If it got not 2xx code and not 404 code it raise error. If it get 404 code it ends successfully.

Definition at line 341 of file FlowUtils.java.

◆ waitFlowStatus()

static FlowIdStatusPayload org.openkilda.flow.FlowUtils.waitFlowStatus ( String  flowName,
FlowState  expected 
) throws InterruptedException
static

Poll flow status via getFlowStatus calls until it become equal to expected. Or until timeout.

TODO: Why do we loop for 10 and sleep for 2? (ie why what for 20 seconds for flow state?)

Returns
last result received from getFlowStatus (can be null)

Definition at line 325 of file FlowUtils.java.


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