• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. API Reference
  4. API Description
  5. Snapshot Management APIs
  6. Creating a Snapshot

Creating a Snapshot

Function

This API is used to create snapshots for a specified cluster.

URI

  • URI format

    POST /v1.0/{project_id}/snapshots

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request

  • Sample request
    POST /v1.0/89cd04f168b84af6be287f71730fdb4b/snapshots
    {
        "snapshot": {
           "name": "snapshot-3",
           "cluster_id": "44b277eb-39be-4921-be31-3d61b43651d7",
           "description": "Snapshot-3 description"
         }
    }
  • Parameter description
    Table 2 Request parameter description

    Parameter

    Mandatory

    Type

    Description

    snapshot

    Yes

    Object

    Snapshot object

    cluster_id

    Yes

    String

    ID of the cluster for which you want to create a snapshot

    name

    Yes

    String

    Snapshot name, which must be unique and start with a letter. It consists of 4 to 64 characters, which are case-insensitive and contain letters, digits, hyphens (-), and underscores (_) only.

    description

    No

    String

    Snapshot description. If no value is specified, the description is empty.

Response

  • Sample response
    STATUS CODE 200
    {
        "snapshot": {
            "id": "2a4d0f86-67cd-408a-8b66-017454fb7793"
        }
    }
  • Parameter description
    Table 3 Response parameter description

    Parameter

    Mandatory

    Type

    Description

    snapshot

    Yes

    Object

    Snapshot object

    id

    Yes

    String

    Snapshot ID

Returned Values

  • Normal

    200

  • Abnormal
    Table 4 Returned value description

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the rights to perform the operation.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    The service is unavailable.