-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor control API #255
Conversation
…nerator/models into control-refactor
…nerator/models into control-refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we update the modeling guide as well so it is clear what should go into state/action/patch ??
control/patch.yaml
Outdated
schemas: | ||
Control.Patch: | ||
description: >- | ||
Request for triggering action on resources in traffic generator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description needs change? this is not triggering action on resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look ok to me.
Looks good to me. |
version: ^0.0.0 | ||
|
||
components: | ||
schemas: | ||
LacpMember.State: | ||
Lacp.State: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if every protocol should also have a set of choices in the heirarchy , since in future we might need to add additional triggers in any protocol (e.g. LACP ) based on end-user requirements. Or we can also choose to have separate choices at top level when the name should probably remain LacpMember to distinguish against future additional triggers,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the most recent discussion, every protocol shall have its own set of choices, if the need arises to add more triggers for a given protocol.
We probably should avoid adding top level choices unless it's a separate protocol altogether. Let me know if you plan to suggest a change here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont we need to then add a choice under Lacp , with a single choice available now ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make it a choice under LACP from the beginning, to make it explicit. Also, new choices might have a different set of arguments to trigger the event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apratimmukherjee @PrasenjitAdhikary kindly review again - I've made the suggested changes.
control/patch.yaml
Outdated
The list of configured flows for which given property will be updated. | ||
type: array | ||
items: | ||
$ref: '../flow/flow.yaml#/components/schemas/Flow' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though this is not related to this PR , I could not follow the exact semantics for patch_config . Lets assume at one time we can update only 1 resource e.g flows. We have 5 flows. Since property names is an array , I assume this means the same set of properties will be updated for all specified flows (e.g. only rate or only size or both i.e. array size possibly cant be more than 2 and values should not be duplicate for properties array. After this , I got confused since looks to me that user has to specify entire flow once again . Should user not be allowed to update only rate or size per flow (specified by flowname) and other properties should be hidden in this API . And validation should be done that specified sub-fields match fields chosen in 'property' array. i.e. should the updatable properties have a dedicated different structure such as flow_patch_attribs etc. Or did I miss the intent of the patch API for flows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason there's no dedicated data structure for updating flow properties like size
and rate
is because from SDK UX POV, it's easier for users to work with.
c = api.config()
f1 = c.flows.add(name='f1')
f1.size.fixed = 256
f1.rate.pps = 500
f2 = c.flows.add(name='f2')
f2.size.fixed = 256
f2.rate.pps = 500
# set config for the first time
api.set_config(c)
# update rate for flow1
f1.rate.pps = 1000
cp = api.control_patch()
cp.flows.property_names = ["rate"]
cp.flows.flows = [f1]
api.set_control_patch(cp)
# fetch newly updated config
cpatched = api.get_config()
# fetched config shall be equivalent to what user already has
assert c == cpatched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we should probably be explicit that only the values set in specified fields ( one of rate or size for flows ) will be patched with current config only for specified flows. The values of all remaining fields in the provided flows will be ignored ( or validated that no other fields are changed ?) . I assume if no changes are done for corresponding attribute , then no separate warning is expected to be provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
control/patch.yaml
Outdated
|
||
components: | ||
schemas: | ||
Control.Patch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike any other control API, this action changes the configuration (which will also reflect in get_config). Need to reflect that in the description, to avoid any ambiguity.
On second thought, if the API should be moved under the configuration
group - and renamed to update_config
- since the other two APIs in the group are also related to configuration and it will be obvious that the configuration would be modified and reflected in get_config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
type: array | ||
items: | ||
type: string | ||
x-constraint: | ||
- '/components/schemas/Port/properties/name' | ||
state: | ||
description: >- | ||
The LACP Member admin state. | ||
The LACP member admin state. | ||
'up' will start transmission of LACPDUs on selected member ports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the descriptions with Subrata/Sourav since I was under the impression that this is no longer accurate.
Can you please change the 'up' and 'down' description to below ( as received from Subrata ) which is more accurate than what was added initially:
'up' will turn on ‘sync’ flag of LACPDUs transmitted from selected member ports.
'down' will turn off ‘sync’ flag of LACPDUs transmitted from selected member ports.
Replaced by #305 |
Check documentation here.
What has changed (and why) ?
control state
,control action
andcontrol patch
capture
,states
andmetrics
under one category calledMonitor
.captured packets
which traditionally doesn't fit the openconfig's interpretation of telemetry.result
is no longer an appropriate terminology because they more closely imply "one-off output" instead of "ever changing output".What's pending ?
result
keyword is mentioned in a lot of places, and hence would like to replace them (only in select places) if we're ok with new terminology - akamonitor
warnings
as an additional output formetrics
/states
. As of today, there's no way to return warning in those scenarios.Backwards Compatibility
Examples
Before
After