Analytics Settings REST API

  • reference
    +

    Overview

    The Analytics Settings REST API is provided by the Analytics service. This API enables you to view or set cluster-level Analytics settings.

    Version information

    Version : 7.6

    Host information

    http://localhost:8091

    The API schemes and host URLs are as follows:

    • http://node:8091/

    • https://node:18091/ (for secure access)

    where node is the host name or IP address of a node running the Analytics service. (Note that the port numbers for this REST API are different to the port numbers used by the other Analytics REST APIs.)

    Resources

    This section describes the operations available with this REST API.

    View Analytics Settings

    GET /settings/analytics

    Description

    Retrieves cluster-level Analytics settings. Note that only one setting is available: numReplicas.

    You can also retrieve the number of Analytic replicas using the Couchbase Web Console or the CLI. For further details about Analytics replicas, refer to Rebalance and Hard Failover.

    Produces

    • application/json

    Responses

    HTTP Code Description Schema

    200

    The operation was successful.

    Settings

    401

    Unauthorized. The user name or password may be incorrect.

    Object

    Security

    Type Name

    http (basic)

    Cluster Read / Pools Read

    Example HTTP Request

    The example below retrieves the current number of Analytics replicas.

    Curl request
    curl -X GET -u Administrator:password \
    http://localhost:8091/settings/analytics

    Example HTTP Response

    Response 200
    {"numReplicas": 1}

    Modify Analytics Settings

    POST /settings/analytics

    Description

    Sets cluster-level Analytics settings. Note that only one setting is available: numReplicas.

    You can also set the number of Analytic replicas using the Couchbase Web Console or the CLI. For further details about Analytics replicas, refer to Rebalance and Hard Failover.

    A rebalance is required for a new numReplicas value to take effect.

    Parameters

    Form Parameters

    Name Description Schema

    numReplicas
    optional

    Specifies the number of replicas for Analytics.

    Minimum: 0
    Maximum: 3

    Integer (int32)

    Produces

    • application/json

    Consumes

    • application/x-www-form-urlencoded

    Responses

    HTTP Code Description Schema

    200

    The operation was successful.

    Settings

    400

    Bad request. A parameter has an incorrect value.

    Object

    401

    Unauthorized. The user name or password may be incorrect.

    Object

    Security

    Type Name

    http (basic)

    Cluster Read / Pools Read

    Example HTTP Request

    The example below changes the current number of Analytics replicas to 2.

    Curl request
    curl -X POST -u Administrator:password \
    http://localhost:8091/settings/analytics \
    -d numReplicas=2

    Example HTTP Response

    Response 200
    {"numReplicas": 2}

    Definitions

    This section describes the properties consumed and returned by this REST API.

    Settings

    Object

    Property Schema

    numReplicas
    required

    Specifies the number of replicas for Analytics.

    Minimum: 0
    Maximum: 3
    Example: 3

    Integer

    Security

    The Analytics Settings REST API supports HTTP basic authentication. Credentials can be passed via HTTP headers.

    Cluster Read / Pools Read

    Users must have one of the following RBAC roles:

    • Full Admin
    • Cluster Admin
    • Read-Only Admin
    • Analytics Admin

    Type : http

    Refer to Roles for more details.