Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ Documentation is versioned for the **docs** and **graphql** sections. Versioned
- `docs_versioned_docs/` and `docs_versioned_sidebars/` (and `docs_versions.json`)
- `graphql_versioned_docs/` and `graphql_versioned_sidebars/` (and `graphql_versions.json`)

The folders `docs/` and `docs-graphql/` are the **“next”** (unreleased) content. They appear in the version dropdown as **“next”** only when running the site locally with `includeCurrentVersion: true` in `docusaurus.config.ts`. **When deployed, the site serves only versioned documentation** (e.g. v25.2, v25.1, v24.1); the “next” content is not shown on the live site.
The folders `docs/` and `docs-graphql/` are the **“next”** (unreleased) content. They appear in the version dropdown as **“next”** only when running the site locally with `includeCurrentVersion: true` in `docusaurus.config.ts`. **When deployed, the site serves only versioned documentation** (e.g. v25.4, v25.3, v25.2); the “next” content is not shown on the live site.

**Where to edit:**

- **For the next release:** Edit the page in `docs/` or `docs-graphql/`. Those are the only places that represent the upcoming release.
- **For the current release (what’s live):** Apply the same change in the corresponding versioned folder (e.g. `docs_versioned_docs/version-v25.2/...` or `graphql_versioned_docs/version-v25.2/...` for the latest). If a fix or clarification should be in the current release, duplicate the change there.
- **For the current release (what’s live):** Apply the same change in the corresponding versioned folder (e.g. `docs_versioned_docs/version-v25.4/...` or `graphql_versioned_docs/version-v25.4/...` for the latest). If a fix or clarification should be in the current release, duplicate the change there.

**Note for reviewers:** The “Edit this page” link always points to the “next” page (`docs/` or `docs-graphql/`). When reviewing PRs, check whether the change should also be ported back to the current version’s versioned folder.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: Admin Endpoints
---

The [Admin Tasks](./admin-tasks/index.md) section provides detailed guides for common administrative operations, but this page provides an exhaustive list of all administrative endpoints available in Dgraph.

Dgraph provides administrative endpoints on both Alpha and Zero nodes.

## Alpha HTTP Endpoints (port 8080)

Dgraph Alpha exposes the following HTTP endpoints on port `8080` (plus optional port offset):

- **`/admin/config/cache_mb`** - Configure cache size
- **`/admin/draining`** - Drain connections from a node
- **`/admin/shutdown`** - Shutdown a single Alpha node
- **`/alter`** - Apply schema updates and drop predicates
- **`/login`** - Authenticate ACL users
- **`/health`** - Health status
- **`/health?all`** - Health status of all servers in the cluster
- **`/state`** - Returns information about the nodes that are part of the cluster. This includes information about the size of predicates and which groups they belong to.

## Zero HTTP Endpoints (port 6080)

Dgraph Zero exposes the following HTTP endpoints on port `6080` (plus optional port offset):

### GET Endpoints

- **`/assign?what=uids&num=100`** - Allocates a range of UIDs specified by the `num` argument, and returns a JSON map containing the `startId` and `endId` that defines the range of UIDs (inclusive). This UID range can be safely assigned externally to new nodes during data ingestion.
- **`/assign?what=timestamps&num=100`** - Requests timestamps from Zero. This is useful to "fast forward" the state of the Zero node when starting from a postings directory that already has commits higher than Zero's leased timestamp.
- **`/removeNode?id=3&group=2`** - Removes a dead Zero or Alpha node. When a replica node goes offline and can't be recovered, you can remove it and add a new node to the quorum. To remove dead Zero nodes, pass `group=0` and the id of the Zero node to this endpoint.

:::note
Before using the `/removeNode` endpoint, ensure that the node is down and ensure that it doesn't come back up ever again. Do not use the same `idx` of a node that was removed earlier.
:::

- **`/moveTablet?tablet=name&group=2`** - Moves a tablet to a group. Zero already rebalances shards every 8 mins, but this endpoint can be used to force move a tablet.

### POST Endpoints

- **`/enterpriseLicense`** - Applies an enterprise license to the cluster by supplying it as part of the body.

## Alpha GraphQL Admin Endpoints (port 8080)

**`/admin`** - GraphQL endpoint for cluster management operations

The GraphQL Admin API provides an alternative way to perform the same administrative tasks available through HTTP endpoints. Many operations that can be done via HTTP endpoints (such as export, backup, shutdown, draining, etc.) can also be performed using GraphQL queries and mutations. The GraphQL interface offers a more structured and type-safe approach to administrative operations.

#### Queries

- **`getGQLSchema`** - Get the current GraphQL schema
- **`health`** - Get health status
- **`state`** - Get cluster state
- **`config`** - Get node configuration
- **`task`** - Get task information
- **`getUser`** - Get a user by name
- **`getGroup`** - Get a group by name
- **`getCurrentUser`** - Get the currently logged in user
- **`queryUser`** - Query users with filters
- **`queryGroup`** - Query groups with filters
- **`listBackups`** - Get information about backups at a given location

#### Mutations

- **`updateGQLSchema`** - Update the Dgraph cluster to serve the input schema. This may change the GraphQL schema, the types and predicates in the Dgraph schema, and cause indexes to be recomputed.
- **`export`** - Start an export of all data in the cluster. Export format should be 'rdf' (the default if no format is given), or 'json'.
- **`draining`** - Set (or unset) the cluster draining mode. In draining mode no further requests are served.
- **`shutdown`** - Shutdown this node.
- **`config`** - Alter the node's config.
- **`removeNode`** - Remove a node from the cluster.
- **`moveTablet`** - Move a predicate from one group to another.
- **`assign`** - Lease UIDs, Timestamps or Namespace IDs in advance.
- **`backup`** - Start a binary backup.
- **`restore`** - Start restoring a binary backup.
- **`restoreTenant`** - Restore given tenant into namespace 0 of the cluster.
- **`login`** - Login to Dgraph. Successful login results in a JWT that can be used in future requests. If login is not successful an error is returned.
- **`addUser`** - Add a user. When linking to groups: if the group doesn't exist it is created; if the group exists, the new user is linked to the existing group. It's possible to both create new groups and link to existing groups in the one mutation. Dgraph ensures that usernames are unique, hence attempting to add an existing user results in an error.
- **`addGroup`** - Add a new group and (optionally) set the rules for the group.
- **`updateUser`** - Update users, their passwords and groups. As with AddUser, when linking to groups: if the group doesn't exist it is created; if the group exists, the new user is linked to the existing group. If the filter doesn't match any users, the mutation has no effect.
- **`updateGroup`** - Add or remove rules for groups. If the filter doesn't match any groups, the mutation has no effect.
- **`deleteGroup`** - Delete a group.
- **`deleteUser`** - Delete a user.
- **`addNamespace`** - Add a new namespace.
- **`deleteNamespace`** - Delete a namespace.
- **`resetPassword`** - Reset password can only be used by the Guardians of the galaxy to reset password of any user in any namespace.


For security configuration including authentication, IP whitelisting, and token-based access control, see [Admin Endpoint Security](./security/admin-endpoint-security).
Loading