Couchbase Tasks API

Endpoints for monitoring and managing backup and restore tasks.

Documentation

Specifications

Other Resources

OpenAPI Specification

couchbase-tasks-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Couchbase Analytics Service REST Allowed CIDRs Tasks API
  description: The Couchbase Analytics Service REST API provides access to the Analytics service for running complex analytical queries on operational data without impacting performance of key-value operations. It supports SQL++ queries for analytics, management of links to external data sources, and configuration of user-defined libraries. The service enables real-time analytics on JSON data alongside transactional workloads.
  version: '7.6'
  contact:
    name: Couchbase Support
    url: https://support.couchbase.com
  termsOfService: https://www.couchbase.com/terms-of-use
servers:
- url: https://localhost:8095
  description: Analytics Service (default port)
- url: https://localhost:18095
  description: Analytics Service (SSL)
security:
- basicAuth: []
tags:
- name: Tasks
  description: Endpoints for monitoring and managing backup and restore tasks.
paths:
  /api/v1/cluster/self/repository/active/{repositoryId}/taskHistory:
    get:
      operationId: getRepositoryTaskHistory
      summary: Get repository task history
      description: Returns the history of backup and restore tasks for the specified active repository, including task types, statuses, and timing.
      tags:
      - Tasks
      parameters:
      - $ref: '#/components/parameters/repositoryId'
      - name: offset
        in: query
        required: false
        description: The earliest date for returned tasks
        schema:
          type: string
          format: date-time
      - name: limit
        in: query
        required: false
        description: Maximum number of tasks to return
        schema:
          type: integer
      - name: task_name
        in: query
        required: false
        description: Filter by task name
        schema:
          type: string
      responses:
        '200':
          description: Successful retrieval of task history
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BackupTask'
        '401':
          description: Unauthorized access
        '404':
          description: Repository not found
  /api/v1/cluster/self/repository/active/{repositoryId}/pause:
    post:
      operationId: pauseRepositoryTasks
      summary: Pause repository tasks
      description: Pauses all scheduled tasks for the specified active repository.
      tags:
      - Tasks
      parameters:
      - $ref: '#/components/parameters/repositoryId'
      responses:
        '200':
          description: Repository tasks paused successfully
        '401':
          description: Unauthorized access
        '404':
          description: Repository not found
  /api/v1/cluster/self/repository/active/{repositoryId}/resume:
    post:
      operationId: resumeRepositoryTasks
      summary: Resume repository tasks
      description: Resumes all paused tasks for the specified active repository.
      tags:
      - Tasks
      parameters:
      - $ref: '#/components/parameters/repositoryId'
      responses:
        '200':
          description: Repository tasks resumed successfully
        '401':
          description: Unauthorized access
        '404':
          description: Repository not found
components:
  parameters:
    repositoryId:
      name: repositoryId
      in: path
      required: true
      description: The name of the backup repository
      schema:
        type: string
  schemas:
    BackupTask:
      type: object
      description: Backup or restore task record
      properties:
        task_name:
          type: string
          description: Name of the task
        status:
          type: string
          description: Task execution status
          enum:
          - done
          - running
          - failed
          - cancelled
        start:
          type: string
          format: date-time
          description: Task start time
        end:
          type: string
          format: date-time
          description: Task end time
        type:
          type: string
          description: Type of task
          enum:
          - BACKUP
          - MERGE
          - RESTORE
        node_runs:
          type: array
          description: Per-node execution details
          items:
            type: object
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Authentication using Couchbase Server credentials.
externalDocs:
  description: Couchbase Analytics Service REST API Documentation
  url: https://docs.couchbase.com/server/current/analytics/rest-analytics.html