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 @@ -183,3 +183,27 @@ def take_action(self, parsed_args):
183183 else :
184184 self .app .log .error ("No changes requested\n " )
185185 return
186+
187+
188+ class ShowVolumeType (show .ShowOne ):
189+ """Display volume type details"""
190+
191+ log = logging .getLogger (__name__ + ".ShowVolumeType" )
192+
193+ def get_parser (self , prog_name ):
194+ parser = super (ShowVolumeType , self ).get_parser (prog_name )
195+ parser .add_argument (
196+ "volume_type" ,
197+ metavar = "<volume-type>" ,
198+ help = "Volume type to display (name or ID)"
199+ )
200+ return parser
201+
202+ def take_action (self , parsed_args ):
203+ self .log .debug ("take_action: (%s)" , parsed_args )
204+ volume_client = self .app .client_manager .volume
205+ volume_type = utils .find_resource (
206+ volume_client .volume_types , parsed_args .volume_type )
207+ properties = utils .format_dict (volume_type ._info .pop ('extra_specs' ))
208+ volume_type ._info .update ({'properties' : properties })
209+ 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