Skip to content

Commit 5223e5a

Browse files
authored
docs: Rewrite GraphQL API documentation for quality and consistency (#601)
2 parents 72e717d + 873cfcf commit 5223e5a

5 files changed

Lines changed: 408 additions & 683 deletions

File tree

docs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@
298298
{
299299
"group": "GraphQL API",
300300
"pages": [
301-
"references/graphql-spec",
302301
"sdks/graphql/configurations",
303302
"sdks/graphql/manage-pods",
304303
"sdks/graphql/manage-pod-templates",
305-
"sdks/graphql/manage-endpoints"
304+
"sdks/graphql/manage-endpoints",
305+
"references/graphql-spec"
306306
]
307307
},
308308
{

sdks/graphql/configurations.mdx

Lines changed: 59 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,62 @@
11
---
2-
title: "Configurations"
2+
title: "Overview"
3+
sidebarTitle: "Overview"
4+
description: "Use the GraphQL API to manage Pods, templates, and Serverless endpoints programmatically."
35
---
46

5-
For details on queries, mutations, fields, and inputs, see the [Runpod GraphQL Spec](https://graphql-spec.runpod.io/).
6-
7-
When configuring your environment, certain arguments are essential to ensure the correct setup and operation. Below is a detailed overview of each required argument:
8-
9-
### `containerDiskInGb`
10-
11-
* **Description**: Specifies the size of the disk allocated for the container in gigabytes. This space is used for the operating system, installed applications, and any data generated or used by the container.
12-
* **Type**: Integer
13-
* **Example**: `10` for a 10 GB disk size.
14-
15-
### `dockerArgs`
16-
17-
* **Description**: If specified, overrides the [container start command](https://docs.docker.com/engine/reference/builder/#cmd). If this argument is not provided, it will rely on the start command provided in the docker image.
18-
* **Type**: String
19-
* **Example**: `sleep infinity` to run the container in the background.
20-
21-
### `env`
22-
23-
* **Description**: A set of environment variables to be set within the container. These can configure application settings, external service credentials, or any other configuration data required by the software running in the container.
24-
* **Type**: Dictionary or Object
25-
* **Example**: `{"DATABASE_URL": "postgres://user:password@localhost/dbname"}`.
26-
27-
### `imageName`
28-
29-
* **Description**: The name of the Docker image to use for the container. This should include the repository name and tag, if applicable.
30-
* **Type**: String
31-
* **Example**: `"nginx:latest"` for the latest version of the Nginx image.
32-
33-
### `name`
34-
35-
* **Description**: The name assigned to the container instance. This name is used for identification and must be unique within the context it's being used.
36-
* **Type**: String
37-
* **Example**: `"my-app-container"`.
38-
39-
### `volumeInGb`
40-
41-
* **Description**: Defines the size of an additional persistent volume in gigabytes. This volume is used for storing data that needs to persist between container restarts or redeployments.
42-
* **Type**: Integer
43-
* **Example**: `5` for a 5GB persistent volume.
44-
45-
Ensure that these arguments are correctly specified in your configuration to avoid errors during deployment.
46-
47-
Optional arguments may also be available, providing additional customization and flexibility for your setup.
7+
Use the GraphQL API to manage Pods, templates, and Serverless endpoints through queries and mutations.
8+
9+
All requests go to `https://api.runpod.io/graphql` with your API key included as a query parameter. For the complete schema including all available queries, mutations, fields, and inputs, see the [GraphQL Spec](https://graphql-spec.runpod.io/).
10+
11+
## Quick start
12+
13+
Make a request using cURL:
14+
15+
```bash
16+
curl --request POST \
17+
--header 'content-type: application/json' \
18+
--url 'https://api.runpod.io/graphql?api_key=YOUR_API_KEY' \
19+
--data '{"query": "query { myself { id email } }"}'
20+
```
21+
22+
Or use a GraphQL client:
23+
24+
```graphql
25+
query {
26+
myself {
27+
id
28+
email
29+
}
30+
}
31+
```
32+
33+
## Common operations
34+
35+
<CardGroup cols={2}>
36+
<Card title="Manage Pods" href="/sdks/graphql/manage-pods" icon="server" horizontal>
37+
Create, start, stop, and query Pods.
38+
</Card>
39+
<Card title="Manage templates" href="/sdks/graphql/manage-pod-templates" icon="layer-group" horizontal>
40+
Create and manage Pod and Serverless templates.
41+
</Card>
42+
<Card title="Manage endpoints" href="/sdks/graphql/manage-endpoints" icon="bolt" horizontal>
43+
Create and configure Serverless endpoints.
44+
</Card>
45+
</CardGroup>
46+
47+
## Common input fields
48+
49+
The following fields are commonly used when creating Pods and templates.
50+
51+
| Field | Type | Description |
52+
|-------|------|-------------|
53+
| `containerDiskInGb` | Integer | Size of the container disk in GB. Used for the operating system, installed applications, and temporary data. |
54+
| `volumeInGb` | Integer | Size of the persistent volume in GB. Data persists between Pod restarts. |
55+
| `imageName` | String | Docker image name including repository and tag (e.g., `nginx:latest`). |
56+
| `name` | String | Name for the resource. Must be unique within your account. |
57+
| `dockerArgs` | String | Overrides the container's default start command. If not specified, uses the image's CMD. |
58+
| `env` | Array | Environment variables as key-value pairs (e.g., `[{key: "VAR", value: "value"}]`). |
59+
| `ports` | String | Ports to expose, formatted as `port/protocol` (e.g., `8888/http,22/tcp`). |
60+
| `gpuTypeId` | String | GPU type identifier (e.g., `NVIDIA RTX A6000`). Use the `gpuTypes` query to list available options. |
61+
| `gpuCount` | Integer | Number of GPUs to allocate. |
62+
| `containerRegistryAuthId` | String | ID of saved registry credentials for private container images. Find this in your [Runpod settings](https://www.runpod.io/console/user/settings). |

0 commit comments

Comments
 (0)