From e19efd4a09ea3a7d4bc6f70c6ea225ba2e7f9d1b Mon Sep 17 00:00:00 2001 From: junboli Date: Tue, 8 Aug 2017 15:12:03 +0800 Subject: [PATCH] [Api-ref] Add metatdata parameters to backup create/update Support metadata for backup resource was introduced in cinder [1] but it's not documented in the API docs anywhere, This change is to add them in the api docs. [1] https://review.openstack.org/#/c/471541/ Change-Id: I0b444b9c48f156786433b7f622bae5dd6f274c59 Closes-bug: #1709254 --- api-ref/source/v3/ext-backups.inc | 3 +- api-ref/source/v3/parameters.yaml | 7 ++++ .../v3/samples/backup-create-request.json | 3 +- .../v3/samples/backup-create-response.json | 3 +- .../v3/samples/backup-update-request.json | 13 +++++--- .../v3/samples/backup-update-response.json | 32 ++++++++++--------- 6 files changed, 38 insertions(+), 23 deletions(-) diff --git a/api-ref/source/v3/ext-backups.inc b/api-ref/source/v3/ext-backups.inc index cc16a87fc54..49e0c4f0e55 100644 --- a/api-ref/source/v3/ext-backups.inc +++ b/api-ref/source/v3/ext-backups.inc @@ -239,6 +239,7 @@ Request - name: name_optional - snapshot_id: snapshot_id_2 - project_id: project_id_path + - metadata: metadata_9 Request Example --------------- @@ -277,7 +278,7 @@ Request - backup: backup - description: description - name: name_optional - + - metadata: metadata_9 Request Example --------------- diff --git a/api-ref/source/v3/parameters.yaml b/api-ref/source/v3/parameters.yaml index 9cbe6dba119..23a2254c577 100644 --- a/api-ref/source/v3/parameters.yaml +++ b/api-ref/source/v3/parameters.yaml @@ -1343,6 +1343,13 @@ metadata_8: in: body required: true type: object +metadata_9: + description: | + The backup metadata key value pairs. + in: body + required: false + type: object + min_version: 3.43 migration_policy: description: | Specify if the volume should be migrated when it is re-typed. diff --git a/api-ref/source/v3/samples/backup-create-request.json b/api-ref/source/v3/samples/backup-create-request.json index c7f8a74d5db..5b3326f75d0 100644 --- a/api-ref/source/v3/samples/backup-create-request.json +++ b/api-ref/source/v3/samples/backup-create-request.json @@ -4,6 +4,7 @@ "description": null, "name": "backup001", "volume_id": "64f5d2fb-d836-4063-b7e2-544d5c1ff607", - "incremental": true + "incremental": true, + "metadata": null } } diff --git a/api-ref/source/v3/samples/backup-create-response.json b/api-ref/source/v3/samples/backup-create-response.json index 815327fcd79..0924dcb2b5e 100644 --- a/api-ref/source/v3/samples/backup-create-response.json +++ b/api-ref/source/v3/samples/backup-create-response.json @@ -11,6 +11,7 @@ "rel": "bookmark" } ], - "name": "backup001" + "name": "backup001", + "metadata": {} } } diff --git a/api-ref/source/v3/samples/backup-update-request.json b/api-ref/source/v3/samples/backup-update-request.json index bcb52e5f808..6cd40f4938b 100644 --- a/api-ref/source/v3/samples/backup-update-request.json +++ b/api-ref/source/v3/samples/backup-update-request.json @@ -1,6 +1,9 @@ { - "backup":{ - "name":"test", - "description": "this is a backup" - } -} \ No newline at end of file + "backup":{ + "name":"test", + "metadata": { + "key": "value" + }, + "description": "this is a backup" + } +} diff --git a/api-ref/source/v3/samples/backup-update-response.json b/api-ref/source/v3/samples/backup-update-response.json index 693377b3dd4..bbd62fd79d8 100644 --- a/api-ref/source/v3/samples/backup-update-response.json +++ b/api-ref/source/v3/samples/backup-update-response.json @@ -1,16 +1,18 @@ { - "backup": { - "id": "fad41a83-203d-4998-9d3b-444fd5da5aba", - "links": [ - { - "href": "http://10.3.150.25:8776/v3/a7090a26bc554d93aa845a4d41808251/backups/fad41a83-203d-4998-9d3b-444fd5da5aba", - "rel": "self" - }, - { - "href": "http://10.3.150.25:8776/a7090a26bc554d93aa845a4d41808251/backups/fad41a83-203d-4998-9d3b-444fd5da5aba", - "rel": "bookmark" - } - ], - "name": "test" - } -} \ No newline at end of file + "backup": { + "id": "fad41a83-203d-4998-9d3b-444fd5da5aba", + "links": [ + { + "href": "http://10.3.150.25:8776/v3/a7090a26bc554d93aa845a4d41808251/backups/fad41a83-203d-4998-9d3b-444fd5da5aba", + "rel": "self" + }, { + "href": "http://10.3.150.25:8776/a7090a26bc554d93aa845a4d41808251/backups/fad41a83-203d-4998-9d3b-444fd5da5aba", + "rel": "bookmark" + } + ], + "name": "test", + "metadata": { + "key": "value" + } + } +}