The Analytics Administration REST APIs are provided by the Analytics service. These APIs enables you to manage and monitor the Analytics service.
Version: 7.6
{scheme}://{host}:{port}
The URL scheme, host, and port are as follows.
| Component | Description |
|---|---|
scheme |
The URL scheme. Use Values: |
host |
The host name or IP address of a node running the Analytics Service. Example: |
port |
The Analytics Service REST port. Use Values: |
This section describes the operations available with this REST API.
Request Cancellation
Cluster Status
Completed Requests
Ingestion Status
Pending Mutations
Cluster Restart
Node Restart
Active Requests
DELETE /analytics/admin/active_requests
Cancels an active request.
-
application/x-www-form-urlencoded
-
application/json
| Name | Description | Schema |
|---|---|---|
client_context_id |
Identifier passed by the client that is used to identify an active request to be cancelled. |
String |
| HTTP Code | Description | Schema |
|---|---|---|
200 |
The operation was successful. |
|
400 |
Bad request. Incorrect parameter or missing value. |
|
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect, or there is no active request with the specified identifier. |
| Type | Name |
|---|---|
http (basic) |
GET /analytics/cluster
Shows various details about the current status of the Analytics Service, such as the service state, the state of each node partition, and the replicas of each partition.
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
200 |
Success. Returns an object giving the current status of the Analytics Service. |
|
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
GET /analytics/admin/completed_requests
Gets a list of all completed analytic requests.
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
200 |
Success. Returns a list of all completed analytic requests. |
Request array |
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
GET /analytics/status/ingestion
Shows the progress of ingestion by the Analytics service, for each Analytics collection.
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
200 |
Success. Returns an object giving the ingestion status of each Analytics collection. |
|
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
GET /analytics/node/agg/stats/remaining
|
Caution
|
This operation is deprecated, and will be removed in a future release. |
Shows the number of mutations in the DCP queue that have not yet been ingested by the Analytics service, for each Analytics collection.
|
Note
|
This endpoint may not return meaningful results in Couchbase Server 7.0 and later. The reported number of mutations may be different to the actual number of mutations in the Analytics collection. For this reason, this endpoint has been deprecated, and you should use the [Ingestion Status](#ingestion_status) endpoint instead. |
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
200 |
Success. Returns an object giving the number of pending mutations for each Analytics collection. |
|
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
POST /analytics/cluster/restart
Restarts all Analytics Service nodes in the cluster.
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
202 |
Accepted. Returns an object showing the status of the cluster. |
Object |
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
POST /analytics/node/restart
Restarts the specified Analytics Service node.
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
202 |
Accepted. Returns an object showing the status of the node. |
Object |
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
GET /analytics/admin/active_requests
Gets a list of the analytic requests that are running.
-
application/json
| HTTP Code | Description | Schema |
|---|---|---|
200 |
Success. Returns an array id details on the running requests. |
Request array |
401 |
Unauthorized. The user name or password may be incorrect. Returns an object containing an error message. Refer to [Error Codes](/server/7.6/analytics/error-codes.html). |
Object |
404 |
Not found. The path may be incorrect. |
| Type | Name |
|---|---|
http (basic) |
This section describes the properties consumed and returned by this REST API.
Ingestion
Links
States
State Scopes
State Collections
Mutations
Collections
Request
Status
Nodes
Partitions
Partition Topology
Partition States
Replicas
| Property | Schema | |
|---|---|---|
links |
An array of objects, each giving information about a single linked Analytics scope. |
Links array |
| Property | Schema | |
|---|---|---|
name |
The name of the link. Example: |
String |
scope |
The name of the Analytics scope. Example: |
String |
status |
The status of the Analytics scope. Values: |
String |
state |
An array of objects, each giving the ingestion state of one or more Analytics collections. Analytics collections which have the same ingestion state within this Analytics scope are aggregated together. |
States array |
| Property | Schema | |
|---|---|---|
timestamp |
The time since epoch that this sample was calculated, in milliseconds. Example: |
Integer |
progress |
The percentage (fraction from 0 to 1) of ingestion progress at the current time. Minimum: |
Double (double) |
timeLag |
The estimated time that the ingestion lags behind the Data service, in milliseconds. Only displayed for Analytics collections that are not fully ingested. Example: |
Integer |
itemsProcessed |
The number of items ingested since last connect; that is, the total number of mutations and deletions processed. Only displayed for Analytics collections that are not fully ingested. Note that this value is reset on connect, so it may appear to get smaller. Example: |
Integer |
seqnoAdvances |
The change in sequence number (seqno) since last connect. Only displayed for Analytics collections that are not fully ingested. Example: |
Integer |
scopes |
An array of objects, each one giving information about a single Analytics scope. |
State Scopes array |
| Property | Schema | |
|---|---|---|
name |
The name of the Analytics scope. Example: |
String |
collections |
An array of objects, each one giving information about a single Analytics collection. |
State Collections array |
| Property | Schema | |
|---|---|---|
name |
The name of the Analytics collection. Example: |
String |
| Property | Schema | |
|---|---|---|
additional |
| Property | Schema | |
|---|---|---|
additional |
The number of mutations in the DCP queue that have not yet been ingested. The name of the property is the name of the Analytics collection. |
Integer |
| Property | Schema | |
|---|---|---|
cancellable |
Whether this request can be cancelled. |
Boolean |
clientContextID |
A context ID for debugging purposes. Example: |
String |
elapsedTime |
How long the request has been running in seconds. Example: |
BigDecimal |
jobCreateTime |
The date and time when the request’s job was created. Example: |
String |
jobId |
The request’s job ID. This value can be null if request did not run (for example, due to an error). Example: |
String |
jobQueueTime |
How long the request’s job has been in the queue waiting to run in seconds. Example: |
BigDecimal |
jobRequiredCPUs |
The number of CPU cores required to run this request. Example: |
Integer |
jobRequiredMemory |
The bytes of RAM being used to process this request. Example: |
Integer |
jobStartTime |
The date and time the request’s job began running. Example: |
String |
jobStatus |
The state of the request’s job. Values: |
String |
plan |
The query plan for this request. |
String |
node |
The Analytics node that received the request. Example: |
String |
remoteAddr |
The network address and port of the client that made the request. Example: |
String |
requestTime |
The date and time the request was received. Example: |
String |
scanConsistency |
The Scan Consistency setting used for the request’s query. Example: |
String |
state |
The state of the request. Values: |
String |
statement |
The SQL++ query statement being run by the request. Example: |
String |
userAgent |
The user agent string of the browser that made the request. Example: |
String |
users |
The user who made the request. Example: |
String |
uuid |
The unique identifier for this request. Example: |
String |
| Property | Schema | |
|---|---|---|
authorizedNodes |
An array of strings, each of which is the ID of an authorized Analytics node. Example: |
String array |
ccNodeId |
The ID of the cluster controller node. Example: |
String |
nodeConfigUri |
The path of the Analytics Node Configuration REST API. Example: |
String |
nodeDiagnosticsUri |
The path of the Analytics Node Diagnostics REST API. For internal use only. Example: |
String |
nodeRestartUri |
The path of the Analytics Node Restart REST API. Example: |
String |
nodeServiceUri |
The path of the Analytics Query Service REST API. Example: |
String |
serviceConfigUri |
The path of the Analytics Service Configuration REST API. Example: |
String |
serviceDiagnosticsUri |
The full URI of the Analytics Service Diagnostics REST API. For internal use only. Example: |
String |
serviceRestartUri |
The full URI of the Analytics Cluster Restart REST API. Example: |
String |
state |
The state of the Analytics Service. Values: |
String |
nodes |
An array of objects, each giving information about one Analytics node. |
Nodes array |
partitions |
An array of objects, each giving information about one Analytics partition. |
Partitions array |
partitionsTopology |
| Property | Schema | |
|---|---|---|
apiBase |
The URI scheme, host, and port for HTTP access to Analytics REST APIs on this node. Example: |
String |
apiBaseHttps |
The URI scheme, host, and port for secure HTTPS access to Analytics REST APIs on this node. Example: |
String |
nodeId |
The ID of the node. Example: |
String |
nodeName |
The name or IP address of the node, including the cluster administration port. Example: |
String |
| Property | Schema | |
|---|---|---|
active |
Indicates whether this partition is active. Example: |
Boolean |
activeNodeId |
The ID of the node where this partition is currently active. Example: |
String |
iodeviceNum |
The number of the IO Device where this partition is located. Example: |
Integer |
nodeId |
The ID of the node where this partition originated. Example: |
String |
partitionId |
The ID of this partition. Example: |
Integer |
path |
The path of the IO Device where this partition is located. Example: |
String |
pendingActivation |
Indicates whether this partition is waiting to become active. Example: |
Boolean |
| Property | Schema | |
|---|---|---|
balanced |
Indicates whether the Analytics nodes are balanced. Example: |
Boolean |
ccNodeId |
The ID of the cluster controller node. Example: |
String |
metadataPartition |
The ID of the metadata partition. Example: |
Integer |
numReplicas |
The number of Analytics replicas. Example: |
Integer |
revision |
The revision number of the partition topology. Example: |
Integer |
version |
The version number of the partition topology. Example: |
Integer |
partitions |
An array of objects, each giving information about the state of one Analytics partition. |
Partition States array |
| Property | Schema | |
|---|---|---|
id |
The partition ID. Example: |
Integer |
master |
The ID of the node where the partition is currently active. Example: |
String |
origin |
The ID of the node where the partition originated. Example: |
String |
replicas |
An array of objects, each giving information about the state of one Analytics replica. |
Replicas array |
| Property | Schema | |
|---|---|---|
location |
The name or IP address of the node where this replica is located, including the Analytics replication port. Example: |
String |
nodeId |
The ID of the node where this replica is located. Example: |
String |
status |
The synchronization status of the replica. Values: |
String |
syncProgress |
The percentage (fraction from 0 to 1) of synchronization progress for this replica at the current time. Minimum: |
Double (double) |
For the [Active Requests](#return_active_requests), [Request Cancellation](#cancel_request), [Completed Requests](#completed_requests), [Ingestion Status](#ingestion_status), and [Pending Mutations](#monitor_node) operations, users must have one of the following access roles:
-
Full Admin
-
Cluster Admin
-
Analytics Manager
-
Analytics Reader
-
Analytics Select
-
Analytics Admin
Type: http
For the [Cluster Status](#cluster_status) operation, users must have one of the following access roles:
-
Full Admin
-
Cluster Admin
-
Read-Only Admin
-
Analytics Admin
Type: http
For the [Cluster Restart](#restart_cluster) and [Node Restart](#restart_node) operations, users must have one of the following RBAC roles:
-
Full Admin
-
Cluster Admin
-
Analytics Admin
Type: http