Add action field for snapshot

Depends-on: https://review.opendev.org/c/openstack/heat/+/976858
Change-Id: Iba70733e8b66755db05b86170b78160d45721f1a
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2026-02-16 17:37:41 +09:00
parent 80e8ac01a6
commit 0c8fddec8d
5 changed files with 23 additions and 2 deletions

View File

@@ -52,7 +52,14 @@ class ListSnapshot(command.Lister):
raise exc.CommandError(_('Stack not found: %s') %
parsed_args.stack)
columns = ['id', 'name', 'status', 'status_reason', 'creation_time']
columns = [
'id',
'name',
'action',
'status',
'status_reason',
'creation_time'
]
return (
columns,
(utils.get_dict_properties(s, columns)
@@ -168,6 +175,7 @@ class CreateSnapshot(command.ShowOne):
columns = [
'ID',
'name',
'action',
'status',
'status_reason',
'data',

View File

@@ -101,6 +101,7 @@ class TestRestoreSnapshot(TestStack):
class TestSnapshotCreate(TestStack):
get_response = {
"action": "CREATE",
"status": "IN_PROGRESS",
"name": "test_snapshot",
"status_reason": None,

View File

@@ -2124,6 +2124,7 @@ class ShellTestUserPass(ShellBase):
resp_dict = {"snapshots": [{
"id": "2",
"name": "snap1",
"action": "CREATE",
"status": "COMPLETE",
"status_reason": "",
"creation_time": "2014-12-05T01:25:52Z"
@@ -2136,6 +2137,7 @@ class ShellTestUserPass(ShellBase):
required = [
'id',
'name',
'action',
'status',
'status_reason',
'creation_time',

View File

@@ -1684,10 +1684,13 @@ def do_snapshot_list(hc, args):
except exc.HTTPNotFound:
raise exc.CommandError(_('Stack not found: %s') % args.id)
else:
fields = ['id', 'name', 'status', 'status_reason', 'creation_time']
fields = [
'id', 'name', 'action', 'status', 'status_reason', 'creation_time'
]
formatters = {
'id': lambda x: x['id'],
'name': lambda x: x['name'],
'action': lambda x: x['action'],
'status': lambda x: x['status'],
'status_reason': lambda x: x['status_reason'],
'creation_time': lambda x: x['creation_time'],

View File

@@ -0,0 +1,7 @@
---
features:
- |
The follwoing commands now shows the new `action` field.
- ``openstack stack snapshot list <stack>``
- ``openstack stack snapshot show <stack> <snapshot>``