Skip to content
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

Update API Documentation #234

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Update API Documentation #234

merged 1 commit into from
Feb 12, 2025

Conversation

unraid-bot
Copy link

@unraid-bot unraid-bot commented Feb 11, 2025

This PR updates the API documentation based on changes from the main repository.

Changes were automatically generated from api/docs/* directory.

@coderabbitai ignore

Copy link
Contributor

coderabbitai bot commented Feb 11, 2025

Walkthrough

The changes update the documentation for the Unraid API by adding detailed sections on the command-line interface (CLI), a comprehensive guide for using the API with GraphQL, and a release roadmap covering upcoming features. The CLI documentation now includes various commands such as start, stop, restart, logs, configuration, API key management, SSO management, and report generation. The API guide outlines steps for enabling developer mode, authentication, schema usage, and best practices, while the roadmap document defines feature statuses across multiple categories.

Changes

File(s) Change Summary
docs/api/public/cli.md Added a new documentation section for CLI commands, detailing commands like start, stop, restart, logs, config, switch-env, developer, apikey, sso (with subcommands), and report, along with notes on permissions and operational requirements.
docs/api/public/how-to-use-the-api.md Introduced a comprehensive guide for using the Unraid API via GraphQL. This includes sections on enabling the GraphQL sandbox, authentication (API keys and cookies), API key creation, available schemas (system information, array, Docker, remote access), example queries, best practices, rate limiting, and error handling.
docs/api/public/upcoming-features.md Added a new document titled "Unraid API Release Roadmap" with tables listing upcoming features, their statuses (Done, Planned, In Progress), and associated version tags.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant API_Server

    User->>CLI: Enter a CLI command (e.g., start, stop)
    CLI->>API_Server: Send command request
    API_Server-->>CLI: Process and return status/logs
    CLI-->>User: Display command output
Loading
sequenceDiagram
    participant User
    participant CLI/Sandbox
    participant API_GraphQL_Server

    User->>CLI/Sandbox: Enable Developer Mode/Access GraphQL Sandbox
    CLI/Sandbox->>API_GraphQL_Server: Authenticate & send GraphQL query
    API_GraphQL_Server-->>CLI/Sandbox: Return queried data
    CLI/Sandbox-->>User: Display results
Loading

Suggested Reviewers

  • ljm42

Poem

I’m a hopping rabbit, full of cheer,
New commands and guides have sprung so near,
CLI magic and GraphQL delight,
My whiskers twitch at every byte.
The Unraid docs now dance in the code,
Hopping along the roadmap road!
🐰✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (5)
docs/api/public/cli.md (2)

11-11: Fix formatting inconsistency in option lists.

The bullet points for command options have inconsistent spacing. Some have extra spaces before the bullet point which affects rendering.

Apply this formatting fix to maintain consistency:

-  - `--log-level`: Optional. Set logging level (trace|debug|info|warn|error)
+- `--log-level`: Optional. Set logging level (trace|debug|info|warn|error)

-  - `--delete`: Optional. Delete the PM2 home directory
+- `--delete`: Optional. Delete the PM2 home directory

-  - `-l, --lines`: Optional. Number of lines to tail (default: 100)
+- `-l, --lines`: Optional. Number of lines to tail (default: 100)

-  - `-e, --environment`: Optional. Target environment (production|staging)
+- `-e, --environment`: Optional. Target environment (production|staging)

-  - `--name <name>`: Name of the key
+- `--name <name>`: Name of the key

-  - `-r, --raw`: Display raw command output
+- `-r, --raw`: Display raw command output

Also applies to: 21-21, 39-39, 59-59, 81-81, 153-153

🧰 Tools
🪛 LanguageTool

[uncategorized] ~11-~11: Loose punctuation mark.
Context: ...the Unraid API service. - --log-level: Optional. Set logging level (trace|debu...

(UNLIKELY_OPENING_PUNCTUATION)


158-161: Enhance the notes section with additional details.

The notes section could benefit from more detailed explanations and proper punctuation.

Apply these improvements:

-1. Most commands that modify the system state will require appropriate permissions.
-2. Some commands may require the API to be running or stopped depending on their function.
-3. When using API keys, ensure you store them securely as they provide access to your system.
-4. SSO configuration changes may require a service restart to take effect.
+1. Most commands that modify the system state will require appropriate permissions (e.g., admin role).
+2. Some commands may require the API to be running or stopped, depending on their function.
+3. When using API keys, ensure you store them securely, as they provide access to your system.
+4. SSO configuration changes may require a service restart to take effect. Use the `restart` command after making changes.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~159-~159: Possible missing comma found.
Context: ...ds may require the API to be running or stopped depending on their function. 3. When us...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~160-~160: Possible missing comma found.
Context: ...n using API keys, ensure you store them securely as they provide access to your system. ...

(AI_HYDRA_LEO_MISSING_COMMA)

docs/api/public/how-to-use-the-api.md (3)

17-19: Add language identifier to the code block.

The code block for the server URL should specify a language for proper syntax highlighting.

Apply this fix:

-```
+```plaintext
http://YOUR_SERVER_IP/graphql
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

17-17: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


26-26: Fix grammatical error in authentication section.

The phrase "signed into" should be "signed in to" when referring to computer systems.

Apply this fix:

-2. Cookies (default method when signed into the WebGUI)
+2. Cookies (default method when signed in to the WebGUI)
🧰 Tools
🪛 LanguageTool

[grammar] ~26-~26: The verb ‘signed into’ is not standard English, except in the context of the law (“The bill was signed into law”). Write “signed in to”. For websites and computers, other options are “logged in to” or “logged on to”.
Context: ...PI Keys 2. Cookies (default method when signed into the WebGUI) ### Creating an API Key U...

(SIGN_INTO)


169-174: Enhance best practices section with security recommendations.

The best practices section could benefit from additional security-focused recommendations.

Add these important security practices:

 1. Use the Apollo Sandbox to explore the schema and test queries
 2. Start with small queries and gradually add fields as needed
 3. Monitor your query complexity to maintain performance
 4. Use appropriate roles and permissions for your API keys
 5. Keep your API keys secure and rotate them periodically
+6. Implement request timeouts in your applications
+7. Use HTTPS for all API communications
+8. Implement proper error handling for rate limits and authentication failures
+9. Regularly audit API key usage and revoke unused keys
🧰 Tools
🪛 LanguageTool

[grammar] ~170-~170: The verb “Monitor” needs to be in the to-infinitive form.
Context: ...all queries and gradually add fields as needed 3. Monitor your query complexity to maintain perfo...

(MISSING_TO_BEFORE_A_VERB)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce3830 and 215d858.

📒 Files selected for processing (3)
  • docs/api/public/cli.md (1 hunks)
  • docs/api/public/how-to-use-the-api.md (1 hunks)
  • docs/api/public/upcoming-features.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/api/public/upcoming-features.md
🧰 Additional context used
🪛 LanguageTool
docs/api/public/cli.md

[uncategorized] ~11-~11: Loose punctuation mark.
Context: ...the Unraid API service. - --log-level: Optional. Set logging level (trace|debu...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~21-~21: Loose punctuation mark.
Context: ...ps the Unraid API service. - --delete: Optional. Delete the PM2 home directory...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~39-~39: Loose punctuation mark.
Context: ...``` View the API logs. - -l, --lines: Optional. Number of lines to tail (defa...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~59-~59: Loose punctuation mark.
Context: ...ing environments. - -e, --environment: Optional. Target environment (productio...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~81-~81: Loose punctuation mark.
Context: ...e API keys. Options: - --name <name>: Name of the key - --create: Create a ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~153-~153: Loose punctuation mark.
Context: ...Generate a system report. - -r, --raw: Display raw command output - `-j, --jso...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~159-~159: Possible missing comma found.
Context: ...ds may require the API to be running or stopped depending on their function. 3. When us...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~160-~160: Possible missing comma found.
Context: ...n using API keys, ensure you store them securely as they provide access to your system. ...

(AI_HYDRA_LEO_MISSING_COMMA)

docs/api/public/how-to-use-the-api.md

[grammar] ~26-~26: The verb ‘signed into’ is not standard English, except in the context of the law (“The bill was signed into law”). Write “signed in to”. For websites and computers, other options are “logged in to” or “logged on to”.
Context: ...PI Keys 2. Cookies (default method when signed into the WebGUI) ### Creating an API Key U...

(SIGN_INTO)


[uncategorized] ~146-~146: Loose punctuation mark.
Context: ...al core types: ### Base Types - Node: Interface for objects with unique IDs -...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~153-~153: Loose punctuation mark.
Context: ... integers ### Resource Types - Array: Array and disk management - Docker: C...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~163-~163: Loose punctuation mark.
Context: ...ased Access Available roles: - admin: Full access - connect: Remote access ...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~170-~170: The verb “Monitor” needs to be in the to-infinitive form.
Context: ...all queries and gradually add fields as needed 3. Monitor your query complexity to maintain perfo...

(MISSING_TO_BEFORE_A_VERB)

🪛 markdownlint-cli2 (0.17.2)
docs/api/public/how-to-use-the-api.md

17-17: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: AWS Amplify Console Web Preview

docs/api/public/how-to-use-the-api.md Outdated Show resolved Hide resolved
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-234.d1o5s833kbd339.amplifyapp.com

@unraid-bot unraid-bot force-pushed the update-api-docs branch 6 times, most recently from 23eea11 to 3010db5 Compare February 12, 2025 14:16
@elibosley elibosley merged commit 27edcdb into main Feb 12, 2025
3 checks passed
@elibosley elibosley deleted the update-api-docs branch February 12, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants