-
Notifications
You must be signed in to change notification settings - Fork 31
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
(DOCSP-46656) Adds handwritten command for atlas api. #838
Conversation
✅ Deploy Preview for docs-atlas-cli ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
97f9aba
to
de5686a
Compare
de5686a
to
312e431
Compare
.. code-block:: | ||
:caption: Command Syntax | ||
|
||
atlas api <tag> <operationId> [options] |
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.
While it's correct that we use <tag>
and <operationId>
, we use a camelCase
version of these values.
This will mainly influence <tag>
, afaik the current operationIds are already in camelCase.
Some examples:
Flex Clusters
->flexClusters
Monitoring and Logs
->monitoringAndLogs
I don't see this captured anywhere in this page yet.
source/command/atlas-api.txt
Outdated
the `API documentation <https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/>`__ | ||
|url| for the endpoint. It appears after ``#tag/``. For example, in | ||
``https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/listClusters``, | ||
the tag is ``Clusters``. |
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.
Regarding my last comment about casing commands would live under atlas api clusters [operationId]
|
||
.. code-block:: shell | ||
|
||
atlas api <tag> <operationId> --orgId <ORG_ID> --invoiceId <INVOICE_ID> |
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 might be helpful to mention that --orgId
and --projectId
are not required; they'll be taken from your profile when they're not set. (Unless they're not set on the profile, then they're needed, but they should be set in most cases)
- Type | ||
- Required | ||
- Description | ||
* - ``--api-version`` |
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 here api_version
can be set as a property on your profile, if that's set then this value will be used when --api-version
is not provided.
source/command/atlas-api.txt
Outdated
* - ``--format`` | ||
- string | ||
- false | ||
- Output format. Supported formats include ``json``, ``csv``, or a Go template. |
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 output format depends on the endpoint.
Most endpoints will output json
, but there are some exceptions.
- When an endpoint supports
json
, then you can providedjson
or a Go template as output. - When an endpoint supports
json
/csv
you can provide all 3 options - There are also endpoints which output binary data, like logs (gzip). In that case
--out
becomes required.
The easiest ways to see what's supported is to:
- check the content response type examples on the API docs example
- run
atlas api <tag> <operationId> --help
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.
A few comments back to you!
source/command/atlas-api.txt
Outdated
:class: singlecol | ||
|
||
Access all features of the `{+atlas-admin-api+} <https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/>`__ | ||
using the {+atlas-cli+} with the syntax: ``atlas api <tag> <operationId>``. |
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.
nit: ambiguous who is "using" the atlas-cli (could refer to the API)
using the {+atlas-cli+} with the syntax: ``atlas api <tag> <operationId>``. | |
by using the {+atlas-cli+} with the syntax: ``atlas api <tag> <operationId>``. |
source/command/atlas-api.txt
Outdated
using the {+atlas-cli+} with the syntax: ``atlas api <tag> <operationId>``. | ||
|
||
This experimental feature streamlines script development by letting you interact | ||
directly with any {+atlas-admin-api+} endpoint using the {+atlas-cli+}. |
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.
directly with any {+atlas-admin-api+} endpoint using the {+atlas-cli+}. | |
directly with any {+atlas-admin-api+} endpoint by using the {+atlas-cli+}. |
|
||
atlas api <tag> <operationId> [options] | ||
|
||
Arguments |
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 should use a table for the arguments here, similar to other pages in the Atlas CLI docs
d48c0db
to
09c2191
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.
LGTM % couple nits for the table so it's easier to read!
Arguments | ||
--------- | ||
|
||
.. list-table:: |
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.
source/command/atlas-api.txt
Outdated
|url| for the endpoint. It appears after ``#tag/``, but you need to change to camelCase. | ||
For example, in | ||
``https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs``, | ||
the tag is ``Monitoring-and-Logs``. In camelCase, it's ``monitoringAndLogs``. | ||
* - <operationId> | ||
- string | ||
- true | ||
- The identifier of the {+atlas-admin-api+} endpoint in :wikipedia:`camelCase <Camel_case>`. | ||
To find the operationId, check the | ||
`API documentation <https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/>`__ | ||
|url| for the endpoint. It appears after ``operation/``. For example, in |
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 these descriptions could benefit from a space between the overview and the example to improve legibility.
|url| for the endpoint. It appears after ``#tag/``, but you need to change to camelCase. | |
For example, in | |
``https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs``, | |
the tag is ``Monitoring-and-Logs``. In camelCase, it's ``monitoringAndLogs``. | |
* - <operationId> | |
- string | |
- true | |
- The identifier of the {+atlas-admin-api+} endpoint in :wikipedia:`camelCase <Camel_case>`. | |
To find the operationId, check the | |
`API documentation <https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/>`__ | |
|url| for the endpoint. It appears after ``operation/``. For example, in | |
|url| for the endpoint. It appears after ``#tag/``, but you need to change to camelCase. | |
For example, in | |
``https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs``, | |
the tag is ``Monitoring-and-Logs``. In camelCase, it's ``monitoringAndLogs``. | |
* - <operationId> | |
- string | |
- true | |
- The identifier of the {+atlas-admin-api+} endpoint in :wikipedia:`camelCase <Camel_case>`. | |
To find the operationId, check the | |
`API documentation <https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/>`__ | |
|url| for the endpoint. It appears after ``operation/``. | |
For example, in |
@@ -93,6 +93,7 @@ Related Commands | |||
accessLists </command/atlas-accessLists> | |||
accessLogs </command/atlas-accessLogs> | |||
alerts </command/atlas-alerts> | |||
api </command/atlas-api> |
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 page is autogenerated, so this change will be overwritten at the next release. I don't think we can have this on this page due to our automation system unless they add it upstream.
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.
@jeroenvervaeke are you able to add this upstream? This is so the new page shows up in the left-hand table of contents.
Self-Review Checklist