-
Notifications
You must be signed in to change notification settings - Fork 19
docs: document client API for python/gRPC client #727
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
Open
mangelajo
wants to merge
1
commit into
main
Choose a base branch
from
client-api-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Client API | ||
|
|
||
| This section provides reference documentation for Jumpstarter's client APIs. Covering topics such as: | ||
|
|
||
| - Listing exporters | ||
| - Requesting a lease | ||
| - Listing leases | ||
|
|
||
| please see the [Client API Reference](reference.md) for more details. | ||
|
|
||
| ## Listing Exporters | ||
|
|
||
| The client library provides a function to list all exporters in the cluster. | ||
|
|
||
| ```python | ||
| from jumpstarter.config.client import ClientConfigV1Alpha1 | ||
|
|
||
| client = ClientConfigV1Alpha1.from_file("~/.config/jumpstarter/clients/majopela.yaml") | ||
| response = client.list_exporters(include_leases=True, include_online=True, page_size=1000) | ||
| for exporter in response.exporters: | ||
| if exporter.online: | ||
| print(exporter.name) | ||
| print(exporter.lease) | ||
|
|
||
| print("next page token: ", response.next_page_token) | ||
| ``` | ||
|
|
||
| ```{toctree} | ||
| :maxdepth: 1 | ||
| :hidden: | ||
| reference.md | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Client API Reference | ||
|
|
||
| ## Loading config files | ||
| ```{eval-rst} | ||
| .. autoclass:: jumpstarter.config.client.ClientConfigV1Alpha1() | ||
| :members: from_file, from_env, load, list | ||
| :exclude-members: __init__ | ||
| ``` | ||
|
|
||
| ## Manipulating config files | ||
| ```{eval-rst} | ||
| .. autoclass:: jumpstarter.config.client.ClientConfigV1Alpha1() | ||
| :no-index: | ||
| :members: save, dump_yaml, list, delete | ||
| :exclude-members: __init__ | ||
| ``` | ||
|
|
||
| ## Interact with the service | ||
| ```{eval-rst} | ||
| .. autoclass:: jumpstarter.config.client.ClientConfigV1Alpha1() | ||
| :no-index: | ||
| :members: get_exporter, list_exporters, create_lease, delete_lease, lease, list_leases, update_lease | ||
| :exclude-members: __init__ | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
Verify that all documented methods exist and have proper docstrings in the source file.
The documentation references 14 methods across three sections. Per the AI summary, docstrings were added to methods in
packages/jumpstarter/jumpstarter/config/client.py, but I need to verify that all referenced methods exist and are properly documented.Additionally, the
listmethod appears in both section 1 (line 6) and section 2 (line 14). Please clarify if this is intentional (a shared utility method used in both loading and manipulating contexts) or if it should only appear in one section.🏁 Script executed:
Length of output: 11944
Remove the non-existent
deletemethod from the documentation.The
deletemethod referenced in section 2 ("Manipulating config files", line 14) does not exist in theClientConfigV1Alpha1class. All other documented methods exist with proper docstrings. Removedeletefrom the:members:list in the second autoclass directive.The
listmethod appearing in both section 1 and section 2 is valid—it applies to both loading and manipulating workflows.🤖 Prompt for AI Agents