File tree Expand file tree Collapse file tree
openstackclient/volume/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,3 +182,27 @@ def take_action(self, parsed_args):
182182 else :
183183 self .app .log .error ("No changes requested\n " )
184184 return
185+
186+
187+ class ShowVolumeType (show .ShowOne ):
188+ """Display volume type details"""
189+
190+ log = logging .getLogger (__name__ + ".ShowVolumeType" )
191+
192+ def get_parser (self , prog_name ):
193+ parser = super (ShowVolumeType , self ).get_parser (prog_name )
194+ parser .add_argument (
195+ "volume_type" ,
196+ metavar = "<volume-type>" ,
197+ help = "Volume type to display (name or ID)"
198+ )
199+ return parser
200+
201+ def take_action (self , parsed_args ):
202+ self .log .debug ("take_action: (%s)" , parsed_args )
203+ volume_client = self .app .client_manager .volume
204+ volume_type = utils .find_resource (
205+ volume_client .volume_types , parsed_args .volume_type )
206+ properties = utils .format_dict (volume_type ._info .pop ('extra_specs' ))
207+ volume_type ._info .update ({'properties' : properties })
208+ return zip (* sorted (six .iteritems (volume_type ._info )))
Original file line number Diff line number Diff line change @@ -365,6 +365,7 @@ openstack.volume.v1 =
365365 volume_type_list = openstackclient.volume.v1.type:ListVolumeType
366366 volume_type_set = openstackclient.volume.v1.type:SetVolumeType
367367 volume_type_unset = openstackclient.volume.v1.type:UnsetVolumeType
368+ volume_type_show = openstackclient.volume.v1.type:ShowVolumeType
368369
369370 volume_qos_associate = openstackclient.volume.v1.qos_specs:AssociateQos
370371 volume_qos_create = openstackclient.volume.v1.qos_specs:CreateQos
You can’t perform that action at this time.
0 commit comments