From 38ab25ec3b9718a4e60b325fd856b8c05a50e738 Mon Sep 17 00:00:00 2001 From: Chris Yeoh Date: Mon, 3 Mar 2014 10:49:22 +1030 Subject: [PATCH] Fixes api samples for V2 os-assisted-volume-snapshots Corrects the api samples for the V2 os-assisted-volume-snapshots. The api samples for the create path were incorrect. This patch fixes them so the documentation for the API will be correct. It doesn't fix the input validation as it would be a backwards incompatible change. Closes-Bug: 1286936 Change-Id: I66a9162e637e3d65bcbd7d033c6c173e67178fbe --- .../snapshot-create-assisted-req.json | 9 ++++----- .../snapshot-create-assisted-req.xml | 12 ++++++------ .../snapshot-create-assisted-req.json.tpl | 9 ++++----- .../snapshot-create-assisted-req.xml.tpl | 10 +++++----- nova/tests/integrated/test_api_samples.py | 5 ++++- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json b/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json index 4425b9dc7ee4..9b6890c8bad8 100644 --- a/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json +++ b/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json @@ -1,10 +1,9 @@ { "snapshot": { - "display_name": "snap-001", - "display_description": "Daily backup", "volume_id": "521752a6-acf6-4b2d-bc7a-119f9148cd8c", - "force": false, - "assisted": true, - "create_info": {} + "create_info": { + "snapshot_id": "421752a6-acf6-4b2d-bc7a-119f9148cd8c", + "type": "qcow", + "new_file": "new_file_name"} } } diff --git a/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml b/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml index 24100bcc670a..9aff79dd2e0a 100644 --- a/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml +++ b/doc/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml @@ -1,9 +1,9 @@ - snap-001 - Daily backup 521752a6-acf6-4b2d-bc7a-119f9148cd8c - false - true - - \ No newline at end of file + + 421752a6-acf6-4b2d-bc7a-119f9148cd8c + qcow + new_file_name + + diff --git a/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json.tpl b/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json.tpl index a1b94d1c7294..defa10203e53 100644 --- a/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json.tpl +++ b/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.json.tpl @@ -1,10 +1,9 @@ { "snapshot": { - "display_name": "%(snapshot_name)s", - "display_description": "%(description)s", "volume_id": "%(volume_id)s", - "force": false, - "assisted": true, - "create_info": {} + "create_info": { + "snapshot_id": "%(snapshot_id)s", + "type": "%(type)s", + "new_file": "%(new_file)s"} } } diff --git a/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml.tpl b/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml.tpl index 45feb5077f92..772bb43d92b9 100644 --- a/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml.tpl +++ b/nova/tests/integrated/api_samples/os-assisted-volume-snapshots/snapshot-create-assisted-req.xml.tpl @@ -1,9 +1,9 @@ - %(snapshot_name)s - %(description)s %(volume_id)s - false - true - + + %(snapshot_id)s + %(type)s + %(new_file)s + diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py index dcecc150fdeb..78a5629ed630 100644 --- a/nova/tests/integrated/test_api_samples.py +++ b/nova/tests/integrated/test_api_samples.py @@ -3725,7 +3725,10 @@ class AssistedVolumeSnapshotsJsonTest(ApiSampleTestBaseV2): subs = { 'snapshot_name': 'snap-001', 'description': 'Daily backup', - 'volume_id': '521752a6-acf6-4b2d-bc7a-119f9148cd8c' + 'volume_id': '521752a6-acf6-4b2d-bc7a-119f9148cd8c', + 'snapshot_id': '421752a6-acf6-4b2d-bc7a-119f9148cd8c', + 'type': 'qcow', + 'new_file': 'new_file_name' } subs.update(self._get_regexes()) response = self._create_assisted_snapshot(subs)