Backup Service API v2 (EXPERIMENTAL)

Backup Service API v2 (EXPERIMENTAL)

Backups (backups)

Backups allow users to record their backups and metadata information about those backups and when backups were taken. It holds the backup information.

GET
/v2/{project_id}/backups

List backups

Lists backups.

This operation lists backups for the project. The backups are sorted alphabetically by name.

Normal response codes: 200

Error response codes:

  • Unauthorized (401)
  • Forbidden (403)

Request Parameters

Name In Type Description
project_id query string The UUID of the project. A project was also known as a tenant.

Query Parameters

Name In Type Description
limit (Optional) query integer Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
marker (Optional) query string The ID of the last-seen item. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.

Response Parameters

Name In Type Description
backups (Optional) body list A list of backups

Response Example

{
  "backups": [
    {
      "backup_id": "96a5946a6e994a38a3d1008fbc6f3406",
      "user_id": "a387de3311484ce58c4560486bc153f1",
      "job_id": "df96800d16fc4d28af75c8451daf0a92",
      "backup_metadata": {
        "ssh_port": 22,
        "curr_backup_level": 0,
        "backup_name": "freezer_mysql_backup",
        "container": "freezer_database_backups",
        "compression": "gzip",
        "dry_run": "",
        "hostname": "backup-node1",
        "storage": "swift",
        "vol_snap_path": "\/var\/lib\/freezer_81856317d419498cb95f3bdffc847361\/.",
        "os_auth_version": "",
        "client_os": "linux2",
        "time_stamp": 1486660214,
        "container_segments": "",
        "ssh_username": "",
        "path_to_backup": "\/var\/lib\/freezer_81856317d419498cb95f3bdffc847361\/.",
        "ssh_key": "",
        "proxy": "",
        "always_level": "",
        "max_level": 14,
        "backup_media": "fs",
        "ssh_host": "",
        "mode": "mysql",
        "fs_real_path": "\/var\/lib\/mysql\/",
        "action": "backup",
        "client_version": "2.0.2",
        "log_file": "\/root\/.freezer\/freezer.log"
      },
      "client_id": "backup-node1",
      "backup_uuid": "9598dd99e1ce42019e498c5493ae1f84",
      "user_name": "os_backup"
    },
    {
      "backup_id": "0cd44caf6db5486b94a04b33256a5ff4",
      "user_id": "a387de3311484ce58c4560486bc153f1",
      "job_id": "b30efac3ef744c45bf3062775ea3525b",
      "backup_metadata": {
        "ssh_port": 22,
        "curr_backup_level": 0,
        "backup_name": "freezer_mysql_backup",
        "container": "freezer_database_backups",
        "compression": "gzip",
        "dry_run": "",
        "hostname": "backup-node1",
        "storage": "swift",
        "vol_snap_path": "\/var\/lib\/freezer_c5d4504387f84b1e96266b6f00bf5f04\/.",
        "os_auth_version": "",
        "client_os": "linux2",
        "time_stamp": 1486660222,
        "container_segments": "",
        "ssh_username": "",
        "path_to_backup": "\/var\/lib\/freezer_c5d4504387f84b1e96266b6f00bf5f04\/.",
        "ssh_key": "",
        "proxy": "",
        "always_level": "",
        "max_level": 14,
        "backup_media": "fs",
        "ssh_host": "",
        "mode": "mysql",
        "fs_real_path": "\/var\/lib\/mysql\/",
        "action": "backup",
        "client_version": "2.0.2",
        "log_file": "\/root\/.freezer\/freezer.log"
      },
      "client_id": "backup-node1",
      "backup_uuid": "2ba51cb9eff543d4b9a530b3c0d2f7cc",
      "user_name": "os_backup"
    }
  ]
}

Jobs (jobs)

Jobs allow users to schedule and execute backup jobs on one node or more. Jobs are stored through the api in the database. Every job contains set of actions that carry out the backup job.

GET
/v2/{project_id}/jobs

List jobs

Lists jobs v2.

This operation lists jobs for the project. The jobs are sorted alphabetically
by name.

Normal response codes: 200

Error response codes:

  • Unauthorized (401)
  • Forbidden (403)

Request Parameters

Name In Type Description
project_id query string The UUID of the project. A project was also known as a tenant.

Query Parameters

Name In Type Description
limit (Optional) query integer Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.
marker (Optional) query string The ID of the last-seen item. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request.

Response Parameters

Name In Type Description
jobs (Optional) body list A list of jobs

Response Example

{
        "jobs":
        [
            {
                "user_id": "0cd44caf6db5486b94a04b33256a5ff4",
                "description": "Test-0001",
                "job_schedule":
                {
                    "schedule_interval": "50 minutes",
                    "status": "scheduled",
                    "time_started": 1493055141,
                    "time_created": 1493051865,
                    "time_ended": 1493055142,
                    "result": "success",
                    "current_pid": 16793,
                    "event": ""
                },
                "client_id": "752d8bd43d654e7a840bbfda77ce41af_szaher",
                "project_id": "752d8bd43d654e7a840bbfda77ce41af",
                "job_actions":
                [
                    {
                        "freezer_action":
                        {
                            "backup_name": "test0001_backup",
                            "container": "/tmp/test0001_container",
                            "no_incremental": true,
                            "path_to_backup": "/etc/",
                            "storage": "local",
                            "log_file": "/home/saad/job0001.log",
                            "snapshot": false,
                            "action": "backup",
                            "remove_older_than": 365,
                            "project_id": "752d8bd43d654e7a840bbfda77ce41af"
                        },
                        "max_retries": 5,
                        "max_retries_interval": 6,
                        "user_id": "0cd44caf6db5486b94a04b33256a5ff4",
                        "action_id": "280d51d041ce4d4da8a386e96263f759"
                    }
                ],
                "job_id": "0ae284d514eb47dd84154748b5056749"
            }
        ]
}
POST
/v2/{project_id}/jobs

Create job

Creates a job v2.

This operation creates a new job.

The body attribute specifies contains a set of actions that gets created
one the job is submitted.

description is the name that you give to the job. The name must not exceed 64 bytes in length.

The job_schedule is very important to schedule the job or it will run only once. also you can provide event which can automatically start/stop the job.

The job_actions the actual backup or restore action to be done.

Normal response codes: 201

Error response codes:

  • BadRequest (400)
  • Unauthorized (401)
  • ServiceUnavailable (503)

Request Parameters

Name In Type Description
description body string The name of the job
job_schedule body dict The schedule information of the job
job_actions body list A list of actions that carry out the backup/restore job.
project_id query string The UUID of the project. A project was also known as a tenant.

Request Example

{
    "description": "Test-0001",
    "job_schedule": {
        "schedule_interval": "5 minutes",
        "status": "scheduled",
        "event": "start"
    },
    "project_id": "752d8bd43d654e7a840bbfda77ce41af",
    "job_actions": [
        {
            "max_retries": 5,
            "max_retries_interval": 6,
            "freezer_action": {
                "backup_name": "test0001_backup",
                "container": "test0001_container",
                "no_incremental": true,
                "path_to_backup": "/etc/",
                "log_file": "/home/saad/job0001.log",
                "snapshot": true,
                "action": "backup",
                "remove_older_than": 365,
                "project_id": "752d8bd43d654e7a840bbfda77ce41af"
            }
        }
]
}

This operation does not return a response body.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.