-
Notifications
You must be signed in to change notification settings - Fork 15
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
[minor_change] Add nd_rest as a new generic ND REST API module. (DCNE-242) #109
base: master
Are you sure you want to change the base?
Conversation
b5a4cdf
to
1af8cb5
Compare
- Some payloads are known not to be idempotent, so be careful when constructing payloads. | ||
""" | ||
|
||
EXAMPLES = r""" |
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.
Missing a PATCH example, but see examples for all the others. Should we add?
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, I will add it.
nd = NDModule(module) | ||
|
||
# Validate content/payload | ||
if content and isinstance(content, str) and HAS_YAML: |
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.
should we also validate json data?
- cisco.nd.modules | ||
|
||
notes: | ||
- Some payloads are known not to be idempotent, so be careful when constructing payloads. |
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.
should we add link reference to nd api docs and or swagger reference?
description: | ||
- Sets the payload of the API request directly. | ||
- This may be convenient to template simple requests. | ||
- For anything complex use the C(template) lookup plugin (see examples). |
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.
perhaps I am missing this example
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.
forgot to add an example for this case, will add it
type: str | ||
required: true | ||
aliases: [ uri ] | ||
content: |
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 also provide a file path with content?
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 should add a new attribute for that
} | ||
} | ||
|
||
- name: Query Security Domain using GET method |
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.
Does this module also support query strings in the path of GET requests?
Should we add some examples using parameters such as, filter
, orderBy
and the pagination options?
Fixes #107
Addition of a new module
nd_rest
to handle generic ND REST API requests.