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
This commit is contained in:
Chris Yeoh 2014-03-03 10:49:22 +10:30
parent e19b294737
commit 38ab25ec3b
5 changed files with 23 additions and 22 deletions

View File

@ -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"}
}
}

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<snapshot>
<display_name>snap-001</display_name>
<display_description>Daily backup</display_description>
<volume_id>521752a6-acf6-4b2d-bc7a-119f9148cd8c</volume_id>
<force>false</force>
<assisted>true</assisted>
<create_info/>
</snapshot>
<create_info>
<snapshot_id>421752a6-acf6-4b2d-bc7a-119f9148cd8c</snapshot_id>
<type>qcow</type>
<new_file>new_file_name</new_file>
</create_info>
</snapshot>

View File

@ -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"}
}
}

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<snapshot>
<display_name>%(snapshot_name)s</display_name>
<display_description>%(description)s</display_description>
<volume_id>%(volume_id)s</volume_id>
<force>false</force>
<assisted>true</assisted>
<create_info/>
<create_info>
<snapshot_id>%(snapshot_id)s</snapshot_id>
<type>%(type)s</type>
<new_file>%(new_file)s</new_file>
</create_info>
</snapshot>

View File

@ -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)