python-openstackclient 6.3.0__py3-none-any.whl → 6.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/common/availability_zone.py +4 -4
- openstackclient/common/pagination.py +82 -0
- openstackclient/compute/v2/flavor.py +2 -16
- openstackclient/compute/v2/hypervisor.py +2 -21
- openstackclient/compute/v2/keypair.py +2 -9
- openstackclient/compute/v2/server.py +220 -131
- openstackclient/compute/v2/server_event.py +30 -19
- openstackclient/compute/v2/server_group.py +2 -23
- openstackclient/compute/v2/server_migration.py +2 -22
- openstackclient/compute/v2/usage.py +4 -6
- openstackclient/identity/v3/mapping.py +25 -3
- openstackclient/identity/v3/policy.py +3 -1
- openstackclient/image/v2/cache.py +218 -0
- openstackclient/image/v2/image.py +40 -17
- openstackclient/image/v2/metadef_namespaces.py +25 -21
- openstackclient/image/v2/metadef_objects.py +189 -0
- openstackclient/image/v2/metadef_properties.py +284 -0
- openstackclient/network/utils.py +100 -0
- openstackclient/network/v2/default_security_group_rule.py +418 -0
- openstackclient/network/v2/local_ip_association.py +1 -1
- openstackclient/network/v2/ndp_proxy.py +7 -3
- openstackclient/network/v2/network.py +2 -2
- openstackclient/network/v2/port.py +65 -19
- openstackclient/network/v2/security_group_rule.py +18 -111
- openstackclient/network/v2/subnet.py +1 -0
- openstackclient/object/v1/container.py +2 -12
- openstackclient/object/v1/object.py +2 -11
- openstackclient/tests/functional/base.py +13 -6
- openstackclient/tests/functional/identity/v3/test_role.py +11 -3
- openstackclient/tests/functional/network/v2/common.py +7 -1
- openstackclient/tests/functional/network/v2/test_address_group.py +2 -4
- openstackclient/tests/functional/network/v2/test_address_scope.py +0 -6
- openstackclient/tests/functional/network/v2/test_default_security_group_rule.py +67 -0
- openstackclient/tests/functional/network/v2/test_floating_ip.py +3 -6
- openstackclient/tests/functional/network/v2/test_ip_availability.py +3 -8
- openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +3 -4
- openstackclient/tests/functional/network/v2/test_local_ip.py +2 -4
- openstackclient/tests/functional/network/v2/test_network.py +18 -17
- openstackclient/tests/functional/network/v2/test_network_agent.py +24 -21
- openstackclient/tests/functional/network/v2/test_network_flavor.py +0 -6
- openstackclient/tests/functional/network/v2/test_network_flavor_profile.py +0 -6
- openstackclient/tests/functional/network/v2/test_network_meter.py +6 -6
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +7 -8
- openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +1 -3
- openstackclient/tests/functional/network/v2/test_network_qos_policy.py +4 -4
- openstackclient/tests/functional/network/v2/test_network_qos_rule.py +16 -20
- openstackclient/tests/functional/network/v2/test_network_qos_rule_type.py +4 -4
- openstackclient/tests/functional/network/v2/test_network_rbac.py +1 -4
- openstackclient/tests/functional/network/v2/test_network_segment.py +7 -12
- openstackclient/tests/functional/network/v2/test_network_segment_range.py +3 -4
- openstackclient/tests/functional/network/v2/test_network_service_provider.py +2 -4
- openstackclient/tests/functional/network/v2/test_network_trunk.py +3 -3
- openstackclient/tests/functional/network/v2/test_port.py +2 -8
- openstackclient/tests/functional/network/v2/test_router.py +0 -6
- openstackclient/tests/functional/network/v2/test_security_group.py +1 -4
- openstackclient/tests/functional/network/v2/test_security_group_rule.py +1 -4
- openstackclient/tests/functional/network/v2/test_subnet.py +4 -22
- openstackclient/tests/functional/network/v2/test_subnet_pool.py +0 -6
- openstackclient/tests/unit/common/test_availability_zone.py +28 -30
- openstackclient/tests/unit/common/test_extension.py +1 -4
- openstackclient/tests/unit/common/test_limits.py +2 -4
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -10
- openstackclient/tests/unit/common/test_quota.py +18 -24
- openstackclient/tests/unit/compute/v2/fakes.py +24 -11
- openstackclient/tests/unit/compute/v2/test_agent.py +1 -1
- openstackclient/tests/unit/compute/v2/test_aggregate.py +62 -72
- openstackclient/tests/unit/compute/v2/test_console.py +18 -30
- openstackclient/tests/unit/compute/v2/test_flavor.py +85 -89
- openstackclient/tests/unit/compute/v2/test_host.py +12 -19
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +23 -25
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -6
- openstackclient/tests/unit/compute/v2/test_keypair.py +25 -39
- openstackclient/tests/unit/compute/v2/test_server.py +316 -365
- openstackclient/tests/unit/compute/v2/test_server_backup.py +5 -17
- openstackclient/tests/unit/compute/v2/test_server_event.py +23 -25
- openstackclient/tests/unit/compute/v2/test_server_group.py +41 -33
- openstackclient/tests/unit/compute/v2/test_server_image.py +6 -18
- openstackclient/tests/unit/compute/v2/test_server_migration.py +45 -45
- openstackclient/tests/unit/compute/v2/test_server_volume.py +15 -31
- openstackclient/tests/unit/compute/v2/test_service.py +51 -56
- openstackclient/tests/unit/compute/v2/test_usage.py +10 -13
- openstackclient/tests/unit/fakes.py +4 -0
- openstackclient/tests/unit/identity/v3/test_mappings.py +9 -4
- openstackclient/tests/unit/identity/v3/test_trust.py +0 -2
- openstackclient/tests/unit/image/v1/fakes.py +2 -1
- openstackclient/tests/unit/image/v1/test_image.py +1 -1
- openstackclient/tests/unit/image/v2/fakes.py +82 -0
- openstackclient/tests/unit/image/v2/test_cache.py +214 -0
- openstackclient/tests/unit/image/v2/test_image.py +62 -4
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +5 -19
- openstackclient/tests/unit/image/v2/test_metadef_objects.py +162 -0
- openstackclient/tests/unit/image/v2/test_metadef_properties.py +227 -0
- openstackclient/tests/unit/integ/cli/test_shell.py +0 -2
- openstackclient/tests/unit/network/test_common.py +3 -3
- openstackclient/tests/unit/network/v2/fakes.py +1 -0
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +1133 -0
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +5 -13
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -9
- openstackclient/tests/unit/network/v2/test_network.py +33 -0
- openstackclient/tests/unit/network/v2/test_network_compute.py +5 -11
- openstackclient/tests/unit/network/v2/test_network_trunk.py +6 -8
- openstackclient/tests/unit/network/v2/test_port.py +83 -38
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +7 -15
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +19 -27
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +3 -6
- openstackclient/tests/unit/network/v2/test_subnet.py +92 -0
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +11 -13
- openstackclient/tests/unit/test_shell.py +1 -7
- openstackclient/tests/unit/utils.py +10 -4
- openstackclient/tests/unit/volume/v1/fakes.py +7 -1
- openstackclient/tests/unit/volume/v1/test_qos_specs.py +2 -2
- openstackclient/tests/unit/volume/v1/test_service.py +1 -1
- openstackclient/tests/unit/volume/v1/test_transfer_request.py +2 -2
- openstackclient/tests/unit/volume/v1/test_type.py +2 -4
- openstackclient/tests/unit/volume/v1/test_volume.py +5 -7
- openstackclient/tests/unit/volume/v1/test_volume_backup.py +4 -4
- openstackclient/tests/unit/volume/v2/fakes.py +32 -12
- openstackclient/tests/unit/volume/v2/test_backup_record.py +1 -1
- openstackclient/tests/unit/volume/v2/test_consistency_group.py +4 -6
- openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py +2 -4
- openstackclient/tests/unit/volume/v2/test_qos_specs.py +2 -2
- openstackclient/tests/unit/volume/v2/test_service.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume.py +78 -16
- openstackclient/tests/unit/volume/v2/test_volume_backend.py +10 -22
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +76 -89
- openstackclient/tests/unit/volume/v2/test_volume_host.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +5 -7
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +4 -8
- openstackclient/tests/unit/volume/v2/test_volume_type.py +164 -24
- openstackclient/tests/unit/volume/v3/fakes.py +91 -15
- openstackclient/tests/unit/volume/v3/test_block_storage_cleanup.py +3 -7
- openstackclient/tests/unit/volume/v3/test_block_storage_cluster.py +11 -31
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +6 -16
- openstackclient/tests/unit/volume/v3/test_block_storage_manage.py +219 -157
- openstackclient/tests/unit/volume/v3/test_block_storage_resource_filter.py +32 -23
- openstackclient/tests/unit/volume/v3/test_volume.py +50 -48
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +17 -47
- openstackclient/tests/unit/volume/v3/test_volume_group.py +23 -65
- openstackclient/tests/unit/volume/v3/test_volume_group_snapshot.py +88 -77
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +14 -42
- openstackclient/tests/unit/volume/v3/test_volume_message.py +10 -28
- openstackclient/volume/v1/volume.py +2 -14
- openstackclient/volume/v2/volume.py +30 -15
- openstackclient/volume/v2/volume_backend.py +10 -18
- openstackclient/volume/v2/volume_backup.py +18 -15
- openstackclient/volume/v2/volume_snapshot.py +2 -12
- openstackclient/volume/v2/volume_type.py +211 -14
- openstackclient/volume/v3/block_storage_manage.py +72 -11
- openstackclient/volume/v3/block_storage_resource_filter.py +33 -11
- openstackclient/volume/v3/volume_attachment.py +2 -14
- openstackclient/volume/v3/volume_group_snapshot.py +27 -27
- openstackclient/volume/v3/volume_message.py +2 -13
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/AUTHORS +11 -0
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/METADATA +6 -5
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/RECORD +160 -151
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/entry_points.txt +23 -5
- python_openstackclient-6.5.0.dist-info/pbr.json +1 -0
- openstackclient/tests/unit/common/test_parseractions.py +0 -233
- python_openstackclient-6.3.0.dist-info/pbr.json +0 -1
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.3.0.dist-info → python_openstackclient-6.5.0.dist-info}/top_level.txt +0 -0
|
@@ -27,7 +27,7 @@ class TestVolumeMessage(volume_fakes.TestVolume):
|
|
|
27
27
|
self.projects_mock = self.app.client_manager.identity.projects
|
|
28
28
|
self.projects_mock.reset_mock()
|
|
29
29
|
|
|
30
|
-
self.volume_messages_mock = self.
|
|
30
|
+
self.volume_messages_mock = self.volume_client.messages
|
|
31
31
|
self.volume_messages_mock.reset_mock()
|
|
32
32
|
|
|
33
33
|
|
|
@@ -46,9 +46,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
46
46
|
self.cmd = volume_message.DeleteMessage(self.app, None)
|
|
47
47
|
|
|
48
48
|
def test_message_delete(self):
|
|
49
|
-
self.
|
|
50
|
-
'3.3'
|
|
51
|
-
)
|
|
49
|
+
self.volume_client.api_version = api_versions.APIVersion('3.3')
|
|
52
50
|
|
|
53
51
|
arglist = [
|
|
54
52
|
self.fake_messages[0].id,
|
|
@@ -66,9 +64,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
66
64
|
self.assertIsNone(result)
|
|
67
65
|
|
|
68
66
|
def test_message_delete_multiple_messages(self):
|
|
69
|
-
self.
|
|
70
|
-
'3.3'
|
|
71
|
-
)
|
|
67
|
+
self.volume_client.api_version = api_versions.APIVersion('3.3')
|
|
72
68
|
|
|
73
69
|
arglist = [
|
|
74
70
|
self.fake_messages[0].id,
|
|
@@ -88,9 +84,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
88
84
|
self.assertIsNone(result)
|
|
89
85
|
|
|
90
86
|
def test_message_delete_multiple_messages_with_exception(self):
|
|
91
|
-
self.
|
|
92
|
-
'3.3'
|
|
93
|
-
)
|
|
87
|
+
self.volume_client.api_version = api_versions.APIVersion('3.3')
|
|
94
88
|
|
|
95
89
|
arglist = [
|
|
96
90
|
self.fake_messages[0].id,
|
|
@@ -120,9 +114,7 @@ class TestVolumeMessageDelete(TestVolumeMessage):
|
|
|
120
114
|
self.assertEqual(2, self.volume_messages_mock.delete.call_count)
|
|
121
115
|
|
|
122
116
|
def test_message_delete_pre_v33(self):
|
|
123
|
-
self.
|
|
124
|
-
'3.2'
|
|
125
|
-
)
|
|
117
|
+
self.volume_client.api_version = api_versions.APIVersion('3.2')
|
|
126
118
|
|
|
127
119
|
arglist = [
|
|
128
120
|
self.fake_messages[0].id,
|
|
@@ -180,9 +172,7 @@ class TestVolumeMessageList(TestVolumeMessage):
|
|
|
180
172
|
self.cmd = volume_message.ListMessages(self.app, None)
|
|
181
173
|
|
|
182
174
|
def test_message_list(self):
|
|
183
|
-
self.
|
|
184
|
-
'3.3'
|
|
185
|
-
)
|
|
175
|
+
self.volume_client.api_version = api_versions.APIVersion('3.3')
|
|
186
176
|
|
|
187
177
|
arglist = []
|
|
188
178
|
verifylist = [
|
|
@@ -206,9 +196,7 @@ class TestVolumeMessageList(TestVolumeMessage):
|
|
|
206
196
|
self.assertCountEqual(self.data, list(data))
|
|
207
197
|
|
|
208
198
|
def test_message_list_with_options(self):
|
|
209
|
-
self.
|
|
210
|
-
'3.3'
|
|
211
|
-
)
|
|
199
|
+
self.volume_client.api_version = api_versions.APIVersion('3.3')
|
|
212
200
|
|
|
213
201
|
arglist = [
|
|
214
202
|
'--project',
|
|
@@ -239,9 +227,7 @@ class TestVolumeMessageList(TestVolumeMessage):
|
|
|
239
227
|
self.assertCountEqual(self.data, list(data))
|
|
240
228
|
|
|
241
229
|
def test_message_list_pre_v33(self):
|
|
242
|
-
self.
|
|
243
|
-
'3.2'
|
|
244
|
-
)
|
|
230
|
+
self.volume_client.api_version = api_versions.APIVersion('3.2')
|
|
245
231
|
|
|
246
232
|
arglist = []
|
|
247
233
|
verifylist = [
|
|
@@ -294,9 +280,7 @@ class TestVolumeMessageShow(TestVolumeMessage):
|
|
|
294
280
|
self.cmd = volume_message.ShowMessage(self.app, None)
|
|
295
281
|
|
|
296
282
|
def test_message_show(self):
|
|
297
|
-
self.
|
|
298
|
-
'3.3'
|
|
299
|
-
)
|
|
283
|
+
self.volume_client.api_version = api_versions.APIVersion('3.3')
|
|
300
284
|
|
|
301
285
|
arglist = [self.fake_message.id]
|
|
302
286
|
verifylist = [('message_id', self.fake_message.id)]
|
|
@@ -309,9 +293,7 @@ class TestVolumeMessageShow(TestVolumeMessage):
|
|
|
309
293
|
self.assertEqual(self.data, data)
|
|
310
294
|
|
|
311
295
|
def test_message_show_pre_v33(self):
|
|
312
|
-
self.
|
|
313
|
-
'3.2'
|
|
314
|
-
)
|
|
296
|
+
self.volume_client.api_version = api_versions.APIVersion('3.2')
|
|
315
297
|
|
|
316
298
|
arglist = [self.fake_message.id]
|
|
317
299
|
verifylist = [('message_id', self.fake_message.id)]
|
|
@@ -26,6 +26,7 @@ from osc_lib.command import command
|
|
|
26
26
|
from osc_lib import exceptions
|
|
27
27
|
from osc_lib import utils
|
|
28
28
|
|
|
29
|
+
from openstackclient.common import pagination
|
|
29
30
|
from openstackclient.i18n import _
|
|
30
31
|
|
|
31
32
|
|
|
@@ -372,20 +373,7 @@ class ListVolume(command.Lister):
|
|
|
372
373
|
default=False,
|
|
373
374
|
help=_('List additional fields in output'),
|
|
374
375
|
)
|
|
375
|
-
|
|
376
|
-
'--offset',
|
|
377
|
-
type=int,
|
|
378
|
-
action=parseractions.NonNegativeAction,
|
|
379
|
-
metavar='<offset>',
|
|
380
|
-
help=_('Index from which to start listing volumes'),
|
|
381
|
-
)
|
|
382
|
-
parser.add_argument(
|
|
383
|
-
'--limit',
|
|
384
|
-
type=int,
|
|
385
|
-
action=parseractions.NonNegativeAction,
|
|
386
|
-
metavar='<num-volumes>',
|
|
387
|
-
help=_('Maximum number of volumes to display'),
|
|
388
|
-
)
|
|
376
|
+
pagination.add_offset_pagination_option_to_parser(parser)
|
|
389
377
|
return parser
|
|
390
378
|
|
|
391
379
|
def take_action(self, parsed_args):
|
|
@@ -26,6 +26,7 @@ from osc_lib.command import command
|
|
|
26
26
|
from osc_lib import exceptions
|
|
27
27
|
from osc_lib import utils
|
|
28
28
|
|
|
29
|
+
from openstackclient.common import pagination
|
|
29
30
|
from openstackclient.i18n import _
|
|
30
31
|
from openstackclient.identity import common as identity_common
|
|
31
32
|
|
|
@@ -33,6 +34,29 @@ from openstackclient.identity import common as identity_common
|
|
|
33
34
|
LOG = logging.getLogger(__name__)
|
|
34
35
|
|
|
35
36
|
|
|
37
|
+
class KeyValueHintAction(argparse.Action):
|
|
38
|
+
"""Uses KeyValueAction or KeyValueAppendAction based on the given key"""
|
|
39
|
+
|
|
40
|
+
APPEND_KEYS = ('same_host', 'different_host')
|
|
41
|
+
|
|
42
|
+
def __init__(self, *args, **kwargs):
|
|
43
|
+
self._key_value_action = parseractions.KeyValueAction(*args, **kwargs)
|
|
44
|
+
self._key_value_append_action = parseractions.KeyValueAppendAction(
|
|
45
|
+
*args, **kwargs
|
|
46
|
+
)
|
|
47
|
+
super().__init__(*args, **kwargs)
|
|
48
|
+
|
|
49
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
|
50
|
+
if values.startswith(self.APPEND_KEYS):
|
|
51
|
+
self._key_value_append_action(
|
|
52
|
+
parser, namespace, values, option_string=option_string
|
|
53
|
+
)
|
|
54
|
+
else:
|
|
55
|
+
self._key_value_action(
|
|
56
|
+
parser, namespace, values, option_string=option_string
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
36
60
|
class AttachmentsColumn(cliff_columns.FormattableColumn):
|
|
37
61
|
"""Formattable column for attachments column.
|
|
38
62
|
|
|
@@ -162,10 +186,12 @@ class CreateVolume(command.ShowOne):
|
|
|
162
186
|
parser.add_argument(
|
|
163
187
|
"--hint",
|
|
164
188
|
metavar="<key=value>",
|
|
165
|
-
action=
|
|
189
|
+
action=KeyValueHintAction,
|
|
166
190
|
help=_(
|
|
167
|
-
"Arbitrary scheduler hint key-value pairs to help
|
|
168
|
-
"
|
|
191
|
+
"Arbitrary scheduler hint key-value pairs to help creating "
|
|
192
|
+
"a volume. Repeat the option to set multiple hints. "
|
|
193
|
+
"'same_host' and 'different_host' get values appended when "
|
|
194
|
+
"repeated, all other keys take the last given value"
|
|
169
195
|
),
|
|
170
196
|
)
|
|
171
197
|
bootable_group = parser.add_mutually_exclusive_group()
|
|
@@ -431,18 +457,7 @@ class ListVolume(command.Lister):
|
|
|
431
457
|
default=False,
|
|
432
458
|
help=_('List additional fields in output'),
|
|
433
459
|
)
|
|
434
|
-
|
|
435
|
-
'--marker',
|
|
436
|
-
metavar='<volume>',
|
|
437
|
-
help=_('The last volume ID of the previous page'),
|
|
438
|
-
)
|
|
439
|
-
parser.add_argument(
|
|
440
|
-
'--limit',
|
|
441
|
-
type=int,
|
|
442
|
-
action=parseractions.NonNegativeAction,
|
|
443
|
-
metavar='<num-volumes>',
|
|
444
|
-
help=_('Maximum number of volumes to display'),
|
|
445
|
-
)
|
|
460
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
446
461
|
return parser
|
|
447
462
|
|
|
448
463
|
def take_action(self, parsed_args):
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
"""Storage backend action implementations"""
|
|
16
16
|
|
|
17
|
+
from osc_lib.cli import format_columns
|
|
17
18
|
from osc_lib.command import command
|
|
18
19
|
from osc_lib import utils
|
|
19
20
|
|
|
@@ -33,7 +34,7 @@ class ShowCapability(command.Lister):
|
|
|
33
34
|
return parser
|
|
34
35
|
|
|
35
36
|
def take_action(self, parsed_args):
|
|
36
|
-
volume_client = self.app.client_manager.volume
|
|
37
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
37
38
|
|
|
38
39
|
columns = [
|
|
39
40
|
'Title',
|
|
@@ -42,7 +43,7 @@ class ShowCapability(command.Lister):
|
|
|
42
43
|
'Description',
|
|
43
44
|
]
|
|
44
45
|
|
|
45
|
-
data = volume_client.
|
|
46
|
+
data = volume_client.get_capabilities(parsed_args.host)
|
|
46
47
|
|
|
47
48
|
# The get capabilities API is... interesting. We only want the names of
|
|
48
49
|
# the capabilities that can set for a backend through extra specs, so
|
|
@@ -83,28 +84,17 @@ class ListPool(command.Lister):
|
|
|
83
84
|
return parser
|
|
84
85
|
|
|
85
86
|
def take_action(self, parsed_args):
|
|
86
|
-
volume_client = self.app.client_manager.volume
|
|
87
|
+
volume_client = self.app.client_manager.sdk_connection.volume
|
|
87
88
|
|
|
88
89
|
if parsed_args.long:
|
|
89
90
|
columns = [
|
|
90
91
|
'name',
|
|
91
|
-
'
|
|
92
|
-
'thick_provisioning_support',
|
|
93
|
-
'thin_provisioning_support',
|
|
94
|
-
'total_volumes',
|
|
95
|
-
'total_capacity_gb',
|
|
96
|
-
'allocated_capacity_gb',
|
|
97
|
-
'max_over_subscription_ratio',
|
|
92
|
+
'capabilities',
|
|
98
93
|
]
|
|
94
|
+
|
|
99
95
|
headers = [
|
|
100
96
|
'Name',
|
|
101
|
-
'
|
|
102
|
-
'Thick',
|
|
103
|
-
'Thin',
|
|
104
|
-
'Volumes',
|
|
105
|
-
'Capacity',
|
|
106
|
-
'Allocated',
|
|
107
|
-
'Max Over Ratio',
|
|
97
|
+
'Capabilities',
|
|
108
98
|
]
|
|
109
99
|
else:
|
|
110
100
|
columns = [
|
|
@@ -112,13 +102,15 @@ class ListPool(command.Lister):
|
|
|
112
102
|
]
|
|
113
103
|
headers = columns
|
|
114
104
|
|
|
115
|
-
data = volume_client.
|
|
105
|
+
data = volume_client.backend_pools(detailed=parsed_args.long)
|
|
106
|
+
formatters = {'capabilities': format_columns.DictColumn}
|
|
116
107
|
return (
|
|
117
108
|
headers,
|
|
118
109
|
(
|
|
119
110
|
utils.get_item_properties(
|
|
120
111
|
s,
|
|
121
112
|
columns,
|
|
113
|
+
formatters=formatters,
|
|
122
114
|
)
|
|
123
115
|
for s in data
|
|
124
116
|
),
|
|
@@ -26,9 +26,9 @@ from osc_lib.command import command
|
|
|
26
26
|
from osc_lib import exceptions
|
|
27
27
|
from osc_lib import utils
|
|
28
28
|
|
|
29
|
+
from openstackclient.common import pagination
|
|
29
30
|
from openstackclient.i18n import _
|
|
30
31
|
|
|
31
|
-
|
|
32
32
|
LOG = logging.getLogger(__name__)
|
|
33
33
|
|
|
34
34
|
|
|
@@ -272,18 +272,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
272
272
|
"Filters results by the volume which they backup (name or ID)"
|
|
273
273
|
),
|
|
274
274
|
)
|
|
275
|
-
|
|
276
|
-
'--marker',
|
|
277
|
-
metavar='<volume-backup>',
|
|
278
|
-
help=_('The last backup of the previous page (name or ID)'),
|
|
279
|
-
)
|
|
280
|
-
parser.add_argument(
|
|
281
|
-
'--limit',
|
|
282
|
-
type=int,
|
|
283
|
-
action=parseractions.NonNegativeAction,
|
|
284
|
-
metavar='<num-backups>',
|
|
285
|
-
help=_('Maximum number of backups to display'),
|
|
286
|
-
)
|
|
275
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
287
276
|
parser.add_argument(
|
|
288
277
|
'--all-projects',
|
|
289
278
|
action='store_true',
|
|
@@ -309,8 +298,22 @@ class ListVolumeBackup(command.Lister):
|
|
|
309
298
|
def take_action(self, parsed_args):
|
|
310
299
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
311
300
|
|
|
312
|
-
columns = (
|
|
313
|
-
|
|
301
|
+
columns = (
|
|
302
|
+
'id',
|
|
303
|
+
'name',
|
|
304
|
+
'description',
|
|
305
|
+
'status',
|
|
306
|
+
'size',
|
|
307
|
+
'is_incremental',
|
|
308
|
+
)
|
|
309
|
+
column_headers = (
|
|
310
|
+
'ID',
|
|
311
|
+
'Name',
|
|
312
|
+
'Description',
|
|
313
|
+
'Status',
|
|
314
|
+
'Size',
|
|
315
|
+
'Incremental',
|
|
316
|
+
)
|
|
314
317
|
if parsed_args.long:
|
|
315
318
|
columns += ('availability_zone', 'volume_id', 'container')
|
|
316
319
|
column_headers += ('Availability Zone', 'Volume', 'Container')
|
|
@@ -25,6 +25,7 @@ from osc_lib.command import command
|
|
|
25
25
|
from osc_lib import exceptions
|
|
26
26
|
from osc_lib import utils
|
|
27
27
|
|
|
28
|
+
from openstackclient.common import pagination
|
|
28
29
|
from openstackclient.i18n import _
|
|
29
30
|
from openstackclient.identity import common as identity_common
|
|
30
31
|
|
|
@@ -228,18 +229,6 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
228
229
|
default=False,
|
|
229
230
|
help=_('List additional fields in output'),
|
|
230
231
|
)
|
|
231
|
-
parser.add_argument(
|
|
232
|
-
'--marker',
|
|
233
|
-
metavar='<volume-snapshot>',
|
|
234
|
-
help=_('The last snapshot ID of the previous page'),
|
|
235
|
-
)
|
|
236
|
-
parser.add_argument(
|
|
237
|
-
'--limit',
|
|
238
|
-
type=int,
|
|
239
|
-
action=parseractions.NonNegativeAction,
|
|
240
|
-
metavar='<num-snapshots>',
|
|
241
|
-
help=_('Maximum number of snapshots to display'),
|
|
242
|
-
)
|
|
243
232
|
parser.add_argument(
|
|
244
233
|
'--name',
|
|
245
234
|
metavar='<name>',
|
|
@@ -268,6 +257,7 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
268
257
|
default=None,
|
|
269
258
|
help=_('Filters results by a volume (name or ID).'),
|
|
270
259
|
)
|
|
260
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
271
261
|
return parser
|
|
272
262
|
|
|
273
263
|
def take_action(self, parsed_args):
|