1
0
forked from docs/doc-exports
doc-exports/docs/opengauss/api-ref/opengauss_newapi_0023.html
Ru, Li Yi d97aea4dd2 opengauss_api
Reviewed-by: Boka, Ladislav <ladislav.boka@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-09-06 09:04:21 +00:00

28 KiB

Querying Backups

Function

This API is used to obtain backups of an instance. Before calling this API:

Constraints

This API can be used to query only manual and automated full backups.

URI

  • URI format

    GET https://{Endpoint}/v3/{project_id}/backups?instance_id={instance_id}&backup_id={backup_id}&backup_type={backup_type}&offset={offset}&limit={limit}&begin_time={begin_time}&end_time={end_time}

  • Example
    • Querying all backups

    https://gaussdb.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/backups

    • Querying instances based on search criteria

    https://gaussdb.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/backups?instance_id=88be33e4c5a64ceba42b42da89310111in14&backup_id=88be1234c5a64ceba42b42da89310111br14&backup_type=auto&begin_time=2022-05-09T16:15:50+0800&end_time=2022-05-09T16:20:45+0800&limit=1&offset=1

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID of a tenant in a region.

    To obtain this value, see Obtaining a Project ID.

    instance_id

    No

    String

    DB instance ID.

    backup_id

    No

    String

    Backup ID, which is compliant with the UUID format.

    backup_type

    No

    String

    Backup type. Value:

    • auto: automated full backup
    • manual: manual full backup

    offset

    No

    Integer

    Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The default value is 0, indicating that the query starts from the first piece of data. The value cannot be a negative number.

    Minimum value: 0

    limit

    No

    Integer

    Number of records to be queried. The default value is 100. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.

    Minimum value: 1

    Maximum value: 100

    begin_time

    No

    String

    Query start time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. This parameter must be used together with end_time.

    end_time

    No

    String

    Query end time. The format is "yyyy-mm-ddThh:mm:ssZ" and the end time must be later than the start time. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. This parameter must be used together with begin_time.

Request

None

Response

  • Normal response
    Table 2 Parameter description

    Parameter

    Type

    Description

    backups

    Array of objects

    Backup information.

    For details, see Table 3.

    total_count

    Long

    Total number of backup files.

    Table 3 backups field data structure description

    Parameter

    Type

    Description

    id

    String

    Backup ID.

    name

    String

    Backup name.

    description

    String

    Description of the backup file.

    begin_time

    String

    Backup start time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.

    end_time

    String

    Backup end time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.

    status

    String

    Backup status.

    Value:

    • BUILDING: Backup in progress
    • COMPLETED: Backup completed
    • FAILED: Backup failed

    size

    Double

    Backup size in MB.

    type

    String

    Backup type.

    Value:

    • auto: automated full backup
    • manual: manual full backup

    datastore

    Object

    Database information.

    For details, see Table 4.

    instance_id

    String

    DB instance ID.

    Table 4 datastore field data structure description

    Parameter

    Type

    Description

    type

    String

    DB engine. The value is case-insensitive and can be:

    GaussDB.

    version

    String

    DB engine version. If this parameter is not specified, the latest version is used by default.

  • Example normal response
    {
        "backups": [
            {
                "id": "a696cd25e4fc453aa503650225cece8bbr14",
                "name": "GaussDB-hly-ha-20220509080110906",
                "description": null,
                "status": "FAILED",
                "size": 0.0,
                "type": "auto",
                "datastore": {
                    "type": "GaussDB",
                    "version": "1.4"
                },
                "begin_time": "2022-05-09T16:01:10+0800",
                "end_time": "2022-05-09T16:04:31+0800",
                "instance_id": "164abc6d35114095bb849d007b19db3bin14"
            },
            {
                "id": "5651c62a7f12461c98020dd3abfe24ccbr14",
                "name": "GaussDB-hly-master-20220509022658257",
                "description": null,
                "status": "FAILED",
                "size": 0.0,
                "type": "auto",
                "datastore": {
                    "type": "GaussDB",
                    "version": "1.4"
                },
                "begin_time": "2022-05-09T10:26:58+0800",
                "end_time": "2022-05-09T10:30:17+0800",
                "instance_id": "fd26e3bf26e5467587eec857e4f66ef0in14"
            }
    	],
        "total_count": 167
    }

Status Code

Error Code

For details, see Error Codes.