Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor control API #255

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 30 additions & 134 deletions api/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,18 @@ paths:
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/control/transmit:
post:
tags: ['Control']
operationId: set_transmit_state
patch:
tags: ['Configuration']
operationId: update_config
description: >-
Updates the state of configuration resources on the traffic generator.

The Response.Warnings in the Success response is available for
implementers to disclose additional information about a state change
including any implicit changes that are outside the scope of the state
change.
Updates specific attributes of resources configured on the traffic generator.
The fetched configuration shall reflect the updates applied successfully.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Transmit.State'
$ref: '../config/update.yaml#/components/schemas/Config.Update'
responses:
'200':
$ref: '../result/request.yaml#/components/responses/Success'
Expand All @@ -59,38 +53,23 @@ paths:
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/control/link:
/control/state:
post:
tags: ['Control']
operationId: set_link_state
operationId: set_control_state
description: >-
Updates the state of configuration resources on the traffic generator.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Link.State'
responses:
'200':
$ref: '../result/request.yaml#/components/responses/Success'
'400':
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'
Sets the state of resources configured on the traffic generator.

/control/capture:
post:
tags: ['Control']
operationId: set_capture_state
description: >-
Updates the state of configuration resources on the traffic generator.
The Response.Warnings in the Success response is available for
implementers to disclose additional information about a state change
including any implicit changes that are outside the scope of the state
change.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Capture.State'
$ref: '../control/state.yaml#/components/schemas/Control.State'
responses:
'200':
$ref: '../result/request.yaml#/components/responses/Success'
Expand All @@ -99,124 +78,41 @@ paths:
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/control/flows:
/control/action:
post:
tags: ['Control']
operationId: update_flows
operationId: set_control_action
description: >-
Updates flow properties without disruption of transmit state.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Flows.Update'
responses:
'200':
description: >-
Response with updated Config from the traffic generator
content:
application/json:
schema:
$ref: '../config/config.yaml#/components/schemas/Config'
'400':
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'
Triggers action on the resources configured on the traffic generator.

/control/routes:
post:
tags: ['Control']
operationId: set_route_state
description: >-
Updates the state of configuration resources on the traffic generator.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Route.State'
responses:
'200':
$ref: '../result/request.yaml#/components/responses/Success'
'400':
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/control/ping:
post:
tags: ['Control']
operationId: send_ping
description: >-
API to send an IPv4 and/or IPv6 ICMP Echo Request(s) between endpoints.
For each endpoint 1 ping packet will be sent and API shall wait for
ping response to either be successful or timeout.
The API wait timeout for each request is 300ms.
The Response.Warnings in the 200 response is available for
implementers to disclose additional information about a state change
including any implicit changes that are outside the scope of the state
change.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Ping.Request'
$ref: '../control/action.yaml#/components/schemas/Control.Action.Request'
responses:
'200':
description: >-
Responses for Ping
Response from traffic generator for actions triggered
content:
application/json:
schema:
$ref: '../control/ping.yaml#/components/schemas/Ping.Response'
'400':
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/control/protocols:
post:
tags: ['Control']
operationId: set_protocol_state
description: >-
Sets all configured protocols to `start` or `stop` state.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Protocol.State'
responses:
'200':
$ref: '../result/request.yaml#/components/responses/Success'
'400':
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/control/devices:
post:
tags: ['Control']
operationId: set_device_state
description: >-
Set specific state/actions on device configuration resources on the traffic generator.
requestBody:
required: true
content:
application/json:
schema:
$ref: '../control/control.yaml#/components/schemas/Device.State'
responses:
'200':
$ref: '../result/request.yaml#/components/responses/Success'
$ref: '../control/action.yaml#/components/schemas/Control.Action.Response'
'400':
$ref: '../result/request.yaml#/components/responses/BadRequest'
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/results/metrics:
/monitor/metrics:
description: >-
Metrics API
post:
tags: ['Metrics']
tags: ['Monitor']
operationId: get_metrics
requestBody:
description: >-
Expand All @@ -239,11 +135,11 @@ paths:
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/results/states:
/monitor/states:
description: >-
States API
post:
tags: ['States']
tags: ['Monitor']
operationId: get_states
requestBody:
description: >-
Expand All @@ -266,11 +162,11 @@ paths:
'500':
$ref: '../result/request.yaml#/components/responses/InternalServerError'

/results/capture:
/monitor/capture:
description: >-
Capture results API
post:
tags: ['Capture']
tags: ['Monitor']
operationId: get_capture
requestBody:
description: >-
Expand Down
723 changes: 0 additions & 723 deletions artifacts/openapi.html

This file was deleted.

Loading