openapi: 3.0.3
info:
  title: Query Settings REST API
  version: '7.6'
  description: |-
    The Query Settings REST API is provided by the Query service.
    This API enables you to view or specify cluster-level Query settings.
servers:
  - url: '{scheme}://{host}:{port}'
    description: The URL scheme, host, and port are as follows.
    variables:
      scheme:
        default: http
        description: |-
          The URL scheme.
          Use `https` for secure access.
        enum:
          - http
          - https
      host:
        default: localhost
        description: The host name or IP address of any node in the Couchbase cluster.
      port:
        default: '8091'
        description: |-
          The Cluster administration REST port.
          Use `18091` for secure access.

          Note that the port numbers for this REST API are different to the port numbers used by the other Query REST APIs.
        enum:
          - '8091'
          - '18091'
paths:
  /settings/querySettings:
    get:
      operationId: get_settings
      summary: Retrieve Cluster-Level Query Settings
      description: Returns all cluster-level query settings, including the CURL access settings.
      security:
        - Default: []
      responses:
        '200':
          description: An object giving cluster-level query settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Settings'
              example:
                queryTmpSpaceDir: /opt/couchbase/var/lib/couchbase/tmp
                queryTmpSpaceSize: 5120
                queryPipelineBatch: 16
                queryPipelineCap: 512
                queryScanCap: 512
                queryTimeout: 0
                queryPreparedLimit: 16384
                queryCompletedLimit: 4000
                queryCompletedThreshold: 1000
                queryLogLevel: info
                queryMaxParallelism: 1
                queryTxTimeout: 0ms
                queryMemoryQuota: 0
                queryUseCBO: true
                queryCleanupClientAttempts: true
                queryCleanupLostAttempts: true
                queryCleanupWindow: 60s
                queryNumAtrs: 1024
                queryNodeQuota: 0
                queryUseReplica: unset
                queryNodeQuotaValPercent: 67
                queryNumCpus: 0
                queryCompletedMaxPlanSize: 262144
                queryN1QLFeatCtrl: 76
                queryCurlWhitelist:
                  all_access: false
    post:
      operationId: post_settings
      summary: Update Cluster-Level Query Settings
      description: Updates cluster-level query settings, including the CURL access settings.
      security:
        - Default: []
      requestBody:
        description: An object specifying cluster-level query settings.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Settings'
            examples:
              partial:
                summary: Partial Settings
                value:
                  queryTmpSpaceDir: /tmp
                  queryTmpSpaceSize: 2048
                  queryCurlWhitelist:
                    all_access: false
              full:
                summary: All Settings
                value:
                  queryTmpSpaceDir: /tmp
                  queryTmpSpaceSize: 2048
                  queryPipelineBatch: 16
                  queryPipelineCap: 512
                  queryScanCap: 512
                  queryTimeout: 0
                  queryPreparedLimit: 16384
                  queryCompletedLimit: 4000
                  queryCompletedThreshold: 1000
                  queryLogLevel: info
                  queryMaxParallelism: 1
                  queryTxTimeout: 0ms
                  queryMemoryQuota: 0
                  queryUseCBO: true
                  queryCleanupClientAttempts: true
                  queryCleanupLostAttempts: true
                  queryCleanupWindow: 60s
                  queryNumAtrs: 1024
                  queryNodeQuota: 0
                  queryUseReplica: unset
                  queryNodeQuotaValPercent: 67
                  queryNumCpus: 0
                  queryCompletedMaxPlanSize: 262144
                  queryN1QLFeatCtrl: 76
                  queryCurlWhitelist:
                    all_access: false
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Settings'
      responses:
        '200':
          description: An object giving cluster-level query settings, including the latest changes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Settings'
              example:
                queryTmpSpaceDir: /tmp
                queryTmpSpaceSize: 2048
                queryPipelineBatch: 16
                queryPipelineCap: 512
                queryScanCap: 512
                queryTimeout: 0
                queryPreparedLimit: 16384
                queryCompletedLimit: 4000
                queryCompletedThreshold: 1000
                queryLogLevel: info
                queryMaxParallelism: 1
                queryTxTimeout: 0ms
                queryMemoryQuota: 0
                queryUseCBO: true
                queryCleanupClientAttempts: true
                queryCleanupLostAttempts: true
                queryCleanupWindow: 60s
                queryNumAtrs: 1024
                queryNodeQuota: 0
                queryUseReplica: unset
                queryNodeQuotaValPercent: 67
                queryNumCpus: 0
                queryCompletedMaxPlanSize: 262144
                queryN1QLFeatCtrl: 76
                queryCurlWhitelist:
                  all_access: false
        '400':
          description: Returns an error message if a parameter or value is incorrect.
          content:
            application/json:
              schema:
                type: object
  /settings/querySettings/curlWhitelist:
    get:
      operationId: get_access
      summary: Retrieve CURL Access List
      description: Returns the cluster-level CURL access settings only.
      security:
        - Default: []
      responses:
        '200':
          description: An object determining which URLs may be accessed by the `CURL()` function.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Access'
              example:
                all_access: false
                allowed_urls: []
                disallowed_urls: []
    post:
      operationId: post_access
      summary: Update CURL Access List
      description: Updates the cluster-level CURL access settings only.
      security:
        - Default: []
      requestBody:
        description: An object determining which URLs may be accessed by the `CURL()` function.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Access'
            example:
              all_access: false
              allowed_urls:
                - https://company1.com
              disallowed_urls:
                - https://company2.com
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Access'
      responses:
        '200':
          description: An object determining which URLs may be accessed by the `CURL()` function, including the latest changes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Access'
              example:
                all_access: false
                allowed_urls:
                  - https://company1.com
                disallowed_urls:
                  - https://company2.com
        '400':
          description: Returns an error message if a parameter or value is incorrect.
          content:
            application/json:
              schema:
                type: object
components:
  schemas:
    Settings:
      type: object
      title: Settings
      properties:
        queryCleanupClientAttempts:
          type: boolean
          default: true
          example: false
          x-has-default: true
          x-has-example: true
          x-desc-name: queryCleanupClientAttempts
          description: When enabled, the Query service preferentially aims to clean up just transactions that it has created, leaving transactions for the distributed cleanup process only when it is forced to.
          x-desc-more: |-
            The [node-level][cleanupclientattempts] `cleanupclientattempts` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [cleanupclientattempts]: ../n1ql-rest-admin/index.html#cleanupclientattempts
          x-desc-refs: '[cleanupclientattempts]: #cleanupclientattempts'
        queryCleanupLostAttempts:
          type: boolean
          default: true
          example: false
          x-has-default: true
          x-has-example: true
          x-desc-name: queryCleanupLostAttempts
          description: When enabled, the Query service takes part in the distributed cleanup process, and cleans up expired transactions created by any client.
          x-desc-more: |-
            The [node-level][cleanuplostattempts] `cleanuplostattempts` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [cleanuplostattempts]: ../n1ql-rest-admin/index.html#cleanuplostattempts
          x-desc-refs: '[cleanuplostattempts]: #cleanuplostattempts'
        queryCleanupWindow:
          type: string
          format: duration
          default: 60s
          example: 30s
          x-has-default: true
          x-has-example: true
          x-desc-name: queryCleanupWindow
          description: |-
            Specifies how frequently the Query service checks its subset of [active transaction records][additional-storage-use] for cleanup.
            Decreasing this setting causes expiration transactions to be found more swiftly, with the tradeoff of increasing the number of reads per second used for the scanning process.

            The value for this setting is a string.
            Its format includes an amount and a mandatory unit, e.g. `10ms` (10 milliseconds) or `0.5s` (half a second).
            Valid units are:

            * `ns` (nanoseconds)
            * `us` (microseconds)
            * `ms` (milliseconds)
            * `s` (seconds)
            * `m` (minutes)
            * `h` (hours)

            [additional-storage-use]: /server/7.6/learn/data/transactions.html#active-transaction-record-entries
          x-desc-more: |-
            The [node-level][cleanupwindow] `cleanupwindow` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [cleanupwindow]: ../n1ql-rest-admin/index.html#cleanupwindow
          x-desc-refs: '[cleanupwindow]: #cleanupwindow'
        queryCompletedLimit:
          type: integer
          format: int32
          default: 4000
          example: 7000
          x-has-default: true
          x-has-example: true
          x-desc-name: queryCompletedLimit
          description: |-
            Sets the number of requests to be logged in the completed requests catalog.
            As new completed requests are added, old ones are removed.

            Increase this when the completed request keyspace is not big enough to track the slow requests, such as when you want a larger sample of slow requests.

            Refer to [Configure the Completed Requests][sys-completed-config] for more information and examples.

            [sys-completed-config]: ../n1ql/n1ql-manage/monitoring-n1ql-query.html#sys-completed-config
          x-desc-more: |-
            The [node-level][completed-limit] `completed-limit` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [completed-limit]: ../n1ql-rest-admin/index.html#completed-limit
          x-desc-refs: |-
            [sys-completed-config]: monitoring-n1ql-query.html#sys-completed-config
            [completed-limit]: #completed-limit
        queryCompletedMaxPlanSize:
          type: integer
          format: int32
          default: 262144
          minimum: 0
          maximum: 20840448
          x-has-default: true
          x-desc-name: queryCompletedMaxPlanSize
          description: |-
            A plan size in bytes.
            Limits the size of query execution plans that can be logged in the completed requests catalog.
            Values larger than the maximum limit are silently treated as the maximum limit.
            Queries with plans larger than this are not logged.
            You must obtain execution plans for such queries via profiling or using the EXPLAIN statement.

            Refer to [Configure the Completed Requests][sys-completed-config] for more information.

            [sys-completed-config]: ../n1ql/n1ql-manage/monitoring-n1ql-query.html#sys-completed-config
          x-desc-more: |-
            The [node-level][completed-max-plan-size] `completed-max-plan-size` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [completed-max-plan-size]: ../n1ql-rest-admin/index.html#completed-max-plan-size
          x-desc-refs: |-
            [sys-completed-config]: monitoring-n1ql-query.html#sys-completed-config
            [completed-max-plan-size]: #completed-max-plan-size
        queryCompletedThreshold:
          type: integer
          format: int32
          default: 1000
          example: 7000
          x-has-default: true
          x-has-example: true
          x-desc-name: queryCompletedThreshold
          description: |-
            A duration in milliseconds.
            All completed queries lasting longer than this threshold are logged in the completed requests catalog.

            Specify `0` to track all requests, independent of duration.
            Specify any negative number to track none.

            Refer to [Configure the Completed Requests][sys-completed-config] for more information and examples.

            [sys-completed-config]: ../n1ql/n1ql-manage/monitoring-n1ql-query.html#sys-completed-config
          x-desc-more: |-
            The [node-level][completed-threshold] `completed-threshold` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [completed-threshold]: ../n1ql-rest-admin/index.html#completed-threshold
          x-desc-refs: |-
            [sys-completed-config]: monitoring-n1ql-query.html#sys-completed-config
            [completed-threshold]: #completed-threshold
        queryLogLevel:
          type: string
          default: INFO
          enum:
            - DEBUG
            - TRACE
            - INFO
            - WARN
            - ERROR
            - SEVERE
            - NONE
          example: DEBUG
          x-has-default: true
          x-has-example: true
          x-desc-name: queryLogLevel
          description: |-
            Log level used in the logger.

            All values, in descending order of data:

            * `DEBUG` &mdash; For developers.
            Writes everything.

            * `TRACE` &mdash; For developers.
            Less info than `DEBUG`.

            * `INFO` &mdash; For admin & customers.
            Lists warnings & errors.

            * `WARN` &mdash; For admin.
            Only abnormal items.

            * `ERROR` &mdash; For admin.
            Only errors to be fixed.

            * `SEVERE` &mdash; For admin.
            Major items, like crashes.

            * `NONE` &mdash; Doesn't write anything.
          x-desc-more: |-
            The [node-level][loglevel] `loglevel` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [loglevel]: ../n1ql-rest-admin/index.html#loglevel
          x-desc-refs: '[loglevel]: #loglevel'
        queryMaxParallelism:
          type: integer
          format: int32
          default: 1
          example: 0
          x-has-default: true
          x-has-example: true
          x-desc-name: queryMaxParallelism
          description: |-
            Specifies the maximum parallelism for queries on all Query nodes in the cluster.

            If the value is zero or negative, the maximum parallelism is restricted to the number of allowed cores.
            Similarly, if the value is greater than the number of allowed cores, the maximum parallelism is restricted to the number of allowed cores.

            (The number of allowed cores is the same as the number of logical CPUs.
            In Community Edition, the number of allowed cores cannot be greater than 4.
            In Enterprise Edition, there is no limit to the number of allowed cores.)

            Refer to [Max Parallelism][max-parallelism] for more information.

            [max-parallelism]: ../n1ql/n1ql-language-reference/index-partitioning.html#max-parallelism
          x-desc-more: |-
            The [node-level][max-parallelism-srv] `max-parallelism` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, there is a [request-level][max_parallelism_req] `max_parallelism` parameter.
            If a request includes this parameter, it will be capped by the node-level `max-parallelism` setting.

            NOTE: To enable queries to run in parallel, you must specify the cluster-level `queryMaxParallelism` parameter, or specify the node-level `max-parallelism` parameter on all Query nodes.

            [max-parallelism-srv]: ../n1ql-rest-admin/index.html#max-parallelism-srv
            [max_parallelism_req]: ../n1ql-rest-query/index.html#max_parallelism_req
          x-desc-refs: |-
            [max-parallelism]:  ../n1ql-language-reference/index-partitioning.html#max-parallelism
            [max-parallelism-srv]: #max-parallelism-srv
            [max_parallelism_req]: #max_parallelism_req
        queryMemoryQuota:
          type: integer
          format: int32
          default: 0
          example: 4
          x-has-default: true
          x-has-example: true
          x-desc-name: queryMemoryQuota
          description: |-
            Specifies the maximum amount of memory a request may use on any Query node in the cluster, in MB.

            This parameter enforces a ceiling on the memory used for the tracked documents required for processing a request.
            It does not take into account any other memory that might be used to process a request, such as the stack, the operators, or some intermediate values.

            Within a transaction, this setting enforces the memory quota for the transaction by tracking the
            delta table and the transaction log (approximately).
          x-desc-more: |-
            The [node-level][memory-quota-srv] `memory-quota` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, there is a [request-level][memory_quota_req] `memory_quota` parameter.
            If a request includes this parameter, it will be capped by the node-level `memory-quota` setting.

            [memory-quota-srv]: ../n1ql-rest-admin/index.html#memory-quota-srv
            [memory_quota_req]: ../n1ql-rest-query/index.html#memory_quota_req
          x-desc-refs: |-
            [memory-quota-srv]: #memory-quota-srv
            [memory_quota_req]: #memory_quota_req
        queryN1QLFeatCtrl:
          type: integer
          format: int32
          x-desc-name: queryN1QLFeatCtrl
          description: |-
            SQL++ feature control.
            This setting is provided for technical support only.
          x-desc-more: |-
            The [node-level][n1ql-feat-ctrl] `n1ql-feat-ctrl` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [n1ql-feat-ctrl]: ../n1ql-rest-admin/index.html#n1ql-feat-ctrl
          x-desc-refs: '[n1ql-feat-ctrl]: #n1ql-feat-ctrl'
        queryNodeQuota:
          type: integer
          format: int32
          default: 0
          x-has-default: true
          x-desc-name: queryNodeQuota
          description: |-
            Sets the soft memory limit for the Query service on every Query node in the cluster, in MB.
            The garbage collector tries to keep below this target.
            It is not a hard, absolute limit, and memory usage may exceed this value.

            When set to `0` (the default), the Query service sets a default soft memory limit for every node.
            To do this, the Query service calculates the difference between the total system RAM and 90% of the total system RAM:

            `Total System RAM - (0.9 * Total System RAM)`

            - If the difference is greater than 8 GiB, the default soft memory limit is set to the total system RAM minus 8 GiB.

            - If the difference is 8 GiB or less, the default soft memory limit is set to 90% of the total system RAM.
          x-desc-more: |-
            The [node-level][node-quota] `node-quota` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [node-quota]: ../n1ql-rest-admin/index.html#node-quota
          x-desc-refs: '[node-quota]: #node-quota'
        queryNodeQuotaValPercent:
          type: integer
          format: int32
          default: 67
          minimum: 0
          maximum: 100
          x-has-default: true
          x-desc-name: queryNodeQuotaValPercent
          description: |-
            The percentage of the `queryNodeQuota` that is dedicated to tracked value content memory across all active requests for every Query node in the cluster.
            (The `queryMemoryQuota` setting specifies the maximum amount of document memory an individual request may use on any Query node in the cluster.)
          x-desc-more: |-
            The [node-level][node-quota-val-percent] `node-quota-val-percent` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [node-quota-val-percent]: ../n1ql-rest-admin/index.html#node-quota-val-percent
          x-desc-refs: '[node-quota-val-percent]: #node-quota-val-percent'
        queryNumAtrs:
          type: integer
          format: int32
          minimum: 0
          exclusiveMinimum: true
          default: 1024
          example: 512
          x-has-default: true
          x-has-example: true
          x-desc-name: queryNumAtrs
          description: |-
            Specifies the total number of [active transaction records][additional-storage-use] for all Query nodes in the cluster.

            [additional-storage-use]: /server/7.6/learn/data/transactions.html#active-transaction-record-entries
          x-desc-more: |-
            The [node-level][numatrs-srv] `numatrs` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [numatrs-srv]: ../n1ql-rest-admin/index.html#numatrs-srv
          x-desc-refs: '[numatrs-srv]: #numatrs-srv'
        queryNumCpus:
          type: integer
          format: int32
          default: 0
          x-has-default: true
          x-desc-name: queryNumCpus
          description: |-
            The number of CPUs the Query service can use on any Query node in the cluster.
            Note that this setting requires a restart of the Query service to take effect.

            When set to `0` (the default), the Query service can use all available CPUs, up to the limits described below.

            The number of CPUs can never be greater than the number of logical CPUs.
            In Community Edition, the number of allowed CPUs cannot be greater than 4.
            In Enterprise Edition, there is no limit to the number of allowed CPUs.
          x-desc-more: |-
            The [node-level][num-cpus] `num-cpus` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [num-cpus]: ../n1ql-rest-admin/index.html#num-cpus
          x-desc-refs: '[num-cpus]: #num-cpus'
        queryPipelineBatch:
          type: integer
          format: int32
          default: 16
          example: 64
          x-has-default: true
          x-has-example: true
          x-desc-name: queryPipelineBatch
          description: Controls the number of items execution operators can batch for Fetch from the KV.
          x-desc-more: |-
            The [node-level][pipeline-batch-srv] `pipeline-batch` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, the [request-level][pipeline_batch_req] `pipeline_batch` parameter specifies this property per request.
            The minimum of that and the node-level `pipeline-batch` setting is applied.

            [pipeline-batch-srv]: ../n1ql-rest-admin/index.html#pipeline-batch-srv
            [pipeline_batch_req]: ../n1ql-rest-query/index.html#pipeline_batch_req
          x-desc-refs: |-
            [pipeline-batch-srv]: #pipeline-batch-srv
            [pipeline_batch_req]: #pipeline_batch_req
        queryPipelineCap:
          type: integer
          format: int32
          default: 512
          example: 1024
          x-has-default: true
          x-has-example: true
          x-desc-name: queryPipelineCap
          description: Maximum number of items each execution operator can buffer between various operators.
          x-desc-more: |-
            The [node-level][pipeline-cap-srv] `pipeline-cap` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, the [request-level][pipeline_cap_req] `pipeline_cap` parameter specifies this property per request.
            The minimum of that and the node-level `pipeline-cap` setting is applied.

            [pipeline-cap-srv]: ../n1ql-rest-admin/index.html#pipeline-cap-srv
            [pipeline_cap_req]: ../n1ql-rest-query/index.html#pipeline_cap_req
          x-desc-refs: |-
            [pipeline-cap-srv]: #pipeline-cap-srv
            [pipeline_cap_req]: #pipeline_cap_req
        queryPreparedLimit:
          type: integer
          format: int32
          default: 16384
          example: 65536
          x-has-default: true
          x-has-example: true
          x-desc-name: queryPreparedLimit
          description: |-
            Maximum number of prepared statements in the cache.
            When this cache reaches the limit, the least recently used prepared statements will be discarded as new prepared statements are created.
          x-desc-more: |-
            The [node-level][prepared-limit] `prepared-limit` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            [prepared-limit]: ../n1ql-rest-admin/index.html#prepared-limit
          x-desc-refs: '[prepared-limit]: #prepared-limit'
        queryScanCap:
          type: integer
          format: int32
          default: 512
          example: 1024
          x-has-default: true
          x-has-example: true
          x-desc-name: queryScanCap
          description: |-
            Maximum buffered channel size between the indexer client and the query service for index scans.
            This parameter controls when to use scan backfill.

            Use `0` or a negative number to disable.
            Smaller values reduce GC, while larger values reduce indexer backfill.
          x-desc-more: |-
            The [node-level][scan-cap-srv] `scan-cap` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, the [request-level][scan_cap_req] `scan_cap` parameter specifies this property per request.
            The minimum of that and the node-level `scan-cap` setting is applied.

            [scan-cap-srv]: ../n1ql-rest-admin/index.html#scan-cap-srv
            [scan_cap_req]: ../n1ql-rest-query/index.html#scan_cap_req
          x-desc-refs: |-
            [scan-cap-srv]: #scan-cap-srv
            [scan_cap_req]: #scan_cap_req
        queryTimeout:
          type: integer
          format: int64
          default: 0
          example: 500000000
          x-has-default: true
          x-has-example: true
          x-desc-name: queryTimeout
          description: |-
            Maximum time to spend on the request before timing out (ns).

            The value for this setting is an integer, representing a duration in nanoseconds.
            It must not be delimited by quotes, and must not include a unit.

            Specify `0` (the default value) or a negative integer to disable.
            When disabled, no timeout is applied and the request runs for however long it takes.
          x-desc-more: |-
            The [node-level][timeout-srv] `timeout` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, the [request-level][timeout_req] `timeout` parameter specifies this property per request.
            The minimum of that and the node-level `timeout` setting is applied.

            [timeout-srv]: ../n1ql-rest-admin/index.html#timeout-srv
            [timeout_req]: ../n1ql-rest-query/index.html#timeout_req
          x-desc-refs: |-
            [timeout-srv]: #timeout-srv
            [timeout_req]: #timeout_req
        queryTxTimeout:
          type: string
          format: duration
          default: 0ms
          example: 0.5s
          x-has-default: true
          x-has-example: true
          x-desc-name: queryTxTimeout
          description: |-
            Maximum time to spend on a transaction before timing out.
            This setting only applies to requests containing the `BEGIN TRANSACTION` statement, or to requests where the [tximplicit][tximplicit] parameter is set.
            For all other requests, it is ignored.

            The value for this setting is a string.
            Its format includes an amount and a mandatory unit, e.g. `10ms` (10 milliseconds) or `0.5s` (half a second).
            Valid units are:

            * `ns` (nanoseconds)
            * `us` (microseconds)
            * `ms` (milliseconds)
            * `s` (seconds)
            * `m` (minutes)
            * `h` (hours)

            Specify `0ms` (the default value) to disable.
            When disabled, no timeout is applied and the transaction runs for however long it takes.

            [tximplicit]: ../n1ql-rest-query/index.html#tximplicit
          x-desc-more: |-
            The [node-level][txtimeout-srv] `txtimeout` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, there is a [request-level][txtimeout_req] `txtimeout` parameter.
            If a request includes this parameter, it will be capped by the node-level `txtimeout` setting.

            [txtimeout-srv]: ../n1ql-rest-admin/index.html#txtimeout-srv
            [txtimeout_req]: ../n1ql-rest-query/index.html#txtimeout_req
          x-desc-refs: |-
            [tximplicit]: #tximplicit
            [txtimeout-srv]: #txtimeout-srv
            [txtimeout_req]: #txtimeout_req
        queryTmpSpaceDir:
          type: string
          example: /opt/couchbase/var/lib/couchbase/tmp
          x-has-example: true
          x-desc-name: queryTmpSpaceDir
          description: |-
            The path to which the indexer writes temporary backfill files, to store any transient data during query processing.

            The specified path must already exist.
            Only absolute paths are allowed.

            The default path is `var/lib/couchbase/tmp` within the Couchbase Server installation directory.
        queryTmpSpaceSize:
          type: integer
          format: int32
          default: 5120
          example: 2048
          x-has-default: true
          x-has-example: true
          x-desc-name: queryTmpSpaceSize
          description: |-
            The maximum size of temporary backfill files (MB).

            Setting the size to `0` disables backfill.
            Setting the size to `-1` means the size is unlimited.

            The maximum size is limited only by the available disk space.
        queryUseCBO:
          type: boolean
          default: true
          example: false
          x-has-default: true
          x-has-example: true
          x-desc-name: queryUseCBO
          description: Specifies whether the cost-based optimizer is enabled.
          x-desc-more: |-
            The [node-level][use-cbo-srv] `use-cbo` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, the [request-level][use_cbo_req] `use_cbo` parameter specifies this property per request.
            If a request does not include this parameter, the node-level setting is used, which defaults to `true`.

            [use-cbo-srv]: ../n1ql-rest-admin/index.html#use-cbo-srv
            [use_cbo_req]: ../n1ql-rest-query/index.html#use_cbo_req
          x-desc-refs: |-
            [use-cbo-srv]: #use-cbo-srv
            [use_cbo_req]: #use_cbo_req
        queryUseReplica:
          type: string
          default: unset
          enum:
            - 'off'
            - 'on'
            - unset
          example: 'on'
          x-has-default: true
          x-has-example: true
          x-desc-name: queryUseReplica
          description: |-
            Specifies whether a query can fetch data from a replica vBucket if active vBuckets are inaccessible.
            The possible values are:

            * `off` &mdash; read from replica is disabled for all queries and cannot be overridden at request level.

            * `on` &mdash; read from replica is enabled for all queries, but can be disabled at request level.

            * `unset` &mdash; read from replica is enabled or disabled at request level.

            Do not enable read from replica when you require consistent results.
            Only SELECT queries that are not within a transaction can read from replica.

            Reading from replica is only possible if the cluster uses Couchbase Server 7.6.0 or later.

            Note that KV range scans cannot currently be started on a replica vBucket.
            If a query uses sequential scan and a data node becomes unavailable, the query might return an error, even if read from replica is enabled for the request.
          x-desc-more: |-
            The [node-level][use-replica-srv] `use-replica` setting specifies this property for a single node.
            When you change the cluster-level setting, the node-level setting is over-written for all nodes in the cluster.

            In addition, the [request-level][use_replica_req] `use_replica` parameter specifies this property per request.
            If a request does not include this parameter, or if the request-level parameter is `unset`, the node-level setting is used.
            If the request-level parameter and the node-level setting are both `unset`, read from replica is disabled for that request.

            [use-replica-srv]: ../n1ql-rest-admin/index.html#use-replica-srv
            [use_replica_req]: ../n1ql-rest-query/index.html#use_replica_req
          x-desc-refs: |-
            [use-replica-srv]: #use-replica-srv
            [use_replica_req]: #use_replica_req
        queryCurlWhitelist:
          $ref: '#/components/schemas/Access'
    Access:
      type: object
      x-desc-name: queryCurlWhitelist
      description: An object which determines which URLs may be accessed by the `CURL()` function.
      required:
        - all_access
      properties:
        all_access:
          type: boolean
          description: |-
            Defines whether the user has access to all URLs, or only URLs specified by the access list.

            This field set must be set to `false` to enable the `allowed_urls` and `disallowed_urls` fields.

            Setting this field to `true` enables access to all endpoints.
        allowed_urls:
          type: array
          description: |-
            An array of strings, each of which is a URL to which you wish to grant access.
            Each URL is a prefix match.
            The CURL() function will allow any URL that starts with this value.

            For example, if you wish to allow access to all Google APIs, add the URL `https://maps.googleapis.com` to the array.
            To allow complete access to `localhost`, use `http://localhost`.

            Note that each URL must include the port, protocol, and all other components of the URL.
          default: []
          items:
            type: string
        disallowed_urls:
          type: array
          description: |-
            An array of strings, each of which is a URL that will be restricted for all roles.
            Each URL is a prefix match.
            The CURL() function will disallow any URL that starts with this value.

            If both `allowed_urls` and `disallowed_urls` fields are populated, the `disallowed_urls` field takes precedence over `allowed_urls`.

            Note that each URL must include the port, protocol, and all other components of the URL.
          default: []
          items:
            type: string
  securitySchemes:
    Default:
      type: http
      scheme: basic
      description: |-
        Users must have one of the following RBAC roles:

        * Full Admin
        * Cluster Admin
