|
| 1 | +--- |
| 2 | +title: Admin Endpoints |
| 3 | +--- |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +Dgraph provides administrative endpoints on both Alpha and Zero nodes. |
| 8 | + |
| 9 | +## Alpha HTTP Endpoints (port 8080) |
| 10 | + |
| 11 | +Dgraph Alpha exposes the following HTTP endpoints on port `8080` (plus optional port offset): |
| 12 | + |
| 13 | +- **`/admin/config/cache_mb`** - Configure cache size |
| 14 | +- **`/admin/draining`** - Drain connections from a node |
| 15 | +- **`/admin/shutdown`** - Shutdown a single Alpha node |
| 16 | +- **`/alter`** - Apply schema updates and drop predicates |
| 17 | +- **`/login`** - Authenticate ACL users |
| 18 | +- **`/health`** - Health status |
| 19 | +- **`/health?all`** - Health status of all servers in the cluster |
| 20 | +- **`/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. |
| 21 | + |
| 22 | +## Zero HTTP Endpoints (port 6080) |
| 23 | + |
| 24 | +Dgraph Zero exposes the following HTTP endpoints on port `6080` (plus optional port offset): |
| 25 | + |
| 26 | +### GET Endpoints |
| 27 | + |
| 28 | +- **`/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. |
| 29 | +- **`/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. |
| 30 | +- **`/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. |
| 31 | + |
| 32 | +:::note |
| 33 | +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. |
| 34 | +::: |
| 35 | + |
| 36 | +- **`/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. |
| 37 | + |
| 38 | +### POST Endpoints |
| 39 | + |
| 40 | +- **`/enterpriseLicense`** - Applies an enterprise license to the cluster by supplying it as part of the body. |
| 41 | + |
| 42 | +## Alpha GraphQL Admin Endpoints (port 8080) |
| 43 | + |
| 44 | +**`/admin`** - GraphQL endpoint for cluster management operations |
| 45 | + |
| 46 | +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. |
| 47 | + |
| 48 | +#### Queries |
| 49 | + |
| 50 | +- **`getGQLSchema`** - Get the current GraphQL schema |
| 51 | +- **`health`** - Get health status |
| 52 | +- **`state`** - Get cluster state |
| 53 | +- **`config`** - Get node configuration |
| 54 | +- **`task`** - Get task information |
| 55 | +- **`getUser`** - Get a user by name |
| 56 | +- **`getGroup`** - Get a group by name |
| 57 | +- **`getCurrentUser`** - Get the currently logged in user |
| 58 | +- **`queryUser`** - Query users with filters |
| 59 | +- **`queryGroup`** - Query groups with filters |
| 60 | +- **`listBackups`** - Get information about backups at a given location |
| 61 | + |
| 62 | +#### Mutations |
| 63 | + |
| 64 | +- **`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. |
| 65 | +- **`export`** - Start an export of all data in the cluster. Export format should be 'rdf' (the default if no format is given), or 'json'. |
| 66 | +- **`draining`** - Set (or unset) the cluster draining mode. In draining mode no further requests are served. |
| 67 | +- **`shutdown`** - Shutdown this node. |
| 68 | +- **`config`** - Alter the node's config. |
| 69 | +- **`removeNode`** - Remove a node from the cluster. |
| 70 | +- **`moveTablet`** - Move a predicate from one group to another. |
| 71 | +- **`assign`** - Lease UIDs, Timestamps or Namespace IDs in advance. |
| 72 | +- **`backup`** - Start a binary backup. |
| 73 | +- **`restore`** - Start restoring a binary backup. |
| 74 | +- **`restoreTenant`** - Restore given tenant into namespace 0 of the cluster. |
| 75 | +- **`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. |
| 76 | +- **`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. |
| 77 | +- **`addGroup`** - Add a new group and (optionally) set the rules for the group. |
| 78 | +- **`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. |
| 79 | +- **`updateGroup`** - Add or remove rules for groups. If the filter doesn't match any groups, the mutation has no effect. |
| 80 | +- **`deleteGroup`** - Delete a group. |
| 81 | +- **`deleteUser`** - Delete a user. |
| 82 | +- **`addNamespace`** - Add a new namespace. |
| 83 | +- **`deleteNamespace`** - Delete a namespace. |
| 84 | +- **`resetPassword`** - Reset password can only be used by the Guardians of the galaxy to reset password of any user in any namespace. |
| 85 | + |
| 86 | + |
| 87 | +For security configuration including authentication, IP whitelisting, and token-based access control, see [Admin Endpoint Security](./security/admin-endpoint-security). |
0 commit comments