-
Notifications
You must be signed in to change notification settings - Fork 75
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
docs: add reference for fix plan API endpoints #2696
Conversation
d1150c7
to
edcdcf4
Compare
edcdcf4
to
a75570c
Compare
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 think defining the complete nested return type for each endpoint makes sense. I think trying to refer to a common definition would be harder to follow
- *List[FixPlanResult]* | ||
- A list of FixPlanResult objects | ||
|
||
- ``uaclient.api.u.pro.security.fix import FixPlanResult`` |
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 wasn't until seeing it laid out in our docs like this that I realized: This is an unversioned return type :/
This is what we're releasing and it's okay, but we should consider changing it next release. I think all return types should be tied directly to the version of the endpoint they're used in. So I think ideally this might get defined in something like api.u.pro.security.fix._common.v1.FixPlanResult
, but we wouldn't tell users about that - instead we'd import and re-export as api.u.pro.security.fix.cve.plan.v1.FixPlanResult
so then the complete nested return type is all defined in the module of the endpoint itself.
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.
That's an excellent point and I will make this change for the next release
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.
+1
I went ahead and created #2714 and assigned it to you
a75570c
to
ddbf76a
Compare
@orndorffgrant updated |
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.
Just some nits
docs/references/api.rst
Outdated
|
||
For example: `pro api u.pro.attach.magic.revoke.v1 --args magic_token=TOKEN` | ||
|
||
* ``data``: Use this to provide a JSON object containing all the data: |
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.
Let's include the --
to make it consistent with --args
* ``data``: Use this to provide a JSON object containing all the data: | |
* ``--data``: Use this to provide a JSON object containing all the data: |
docs/references/api.rst
Outdated
|
||
* ``--args``: Use this to individually provide arguments to the CLI endpoint. | ||
|
||
For example: `pro api u.pro.attach.magic.revoke.v1 --args magic_token=TOKEN` |
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.
Currently this is italics
For example: `pro api u.pro.attach.magic.revoke.v1 --args magic_token=TOKEN` | |
For example: ``pro api u.pro.attach.magic.revoke.v1 --args magic_token=TOKEN`` |
docs/references/api.rst
Outdated
|
||
* ``data``: Use this to provide a JSON object containing all the data: | ||
|
||
For example: `pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": ["CVE-1234-1235"]}'` |
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.
For example: `pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": ["CVE-1234-1235"]}'` | |
For example: ``pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": ["CVE-1234-1235"]}'`` |
- *List[FixPlanResult]* | ||
- A list of FixPlanResult objects | ||
|
||
- ``uaclient.api.u.pro.security.fix import FixPlanResult`` |
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.
+1
I went ahead and created #2714 and assigned it to you
docs/references/api.rst
Outdated
|
||
.. code-block:: bash | ||
|
||
pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": [...]}' |
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 think we might as well include the sample example cve strings as the python example
pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": [...]}' | |
pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": ["CVE-1234-1234", "CVE-1234-1235"]}' |
docs/references/api.rst
Outdated
|
||
from uaclient.api.u.pro.security.fix.usn.plan.v1 import plan, USNFixPlanOptions | ||
|
||
options = USNFixPlanOptions(cves=["USN-1234-1", "CVE-1235-1"]) |
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.
This includes a CVE in the example
options = USNFixPlanOptions(cves=["USN-1234-1", "CVE-1235-1"]) | |
options = USNFixPlanOptions(cves=["USN-1234-1", "USN-1235-1"]) |
docs/references/api.rst
Outdated
|
||
.. code-block:: bash | ||
|
||
pro api u.pro.security.fix.usn.plan.v1 --data '{"usns": [...]}' |
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.
Same comment as above
pro api u.pro.security.fix.usn.plan.v1 --data '{"usns": [...]}' | |
pro api u.pro.security.fix.usn.plan.v1 --data '{"usns": ["USN-1234-1", "USN-1235-1"]}' |
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.
Just two quick nits, otherwise I think this should be good to go
docs/references/api.rst
Outdated
- Introduced in Ubuntu Pro Client Version: ``29~`` | ||
- Args: | ||
|
||
- ``cves``: A list of CVEs (i.e CVE-2023-2650) titles |
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.
- ``cves``: A list of CVEs (i.e CVE-2023-2650) titles | |
- ``cves``: A list of CVE (i.e. CVE-2023-2650) titles |
docs/references/api.rst
Outdated
- Introduced in Ubuntu Pro Client Version: ``29~`` | ||
- Args: | ||
|
||
- ``usns``: A list of USNs (i.e CVE-6188-1) titles |
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'm not sure if this is intended or not, but a couple of times in this section about the usn endpoint there are references to CVE (like here). Might be worth a double-check to make sure that any references to CVE for this endpoint are intended (I'm not sure!)
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.
Good catch @s-makin, this is indeed incorrect. I will fix that
ddbf76a
to
4a71a78
Compare
@orndorffgrant @s-makin updated |
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 :) thanks for all your work on this
Why is this needed?
Add references for the fix plan API endpoints that will be released in the next Pro release