func (cl *Client) ListBlockDevice(filters ...interface{}) ([]blockdevice.BlockDevice, error) {
	bdList := &v1alpha1.BlockDeviceList{
		TypeMeta: metav1.TypeMeta{
			Kind:       "BlockDevice",
			APIVersion: "openebs.io/v1alpha1",
		},
	}

	// list only from this namespace
	listOpts := []client.ListOption{
		client.InNamespace(cl.namespace),
	}

	for _, filter := range filters {
		// convert the filter interface to relevant list option
		opts := filter.(client.ListOption)
		listOpts = append(listOpts, opts)
	}

	err := cl.client.List(context.TODO(), bdList, listOpts...)
	if err != nil {
		klog.Error("error in listing BDs. ", err)
		return nil, err
	}

	blockDeviceList := make([]blockdevice.BlockDevice, 0)
	err = convertBlockDeviceAPIListToBlockDeviceList(bdList, &blockDeviceList)
	if err != nil {
		return blockDeviceList, err
	}

	klog.V(4).Infof("no of blockdevices listed : %d", len(blockDeviceList))

	return blockDeviceList, nil
}
// ListBlockDevice lists the block device from etcd based on
// the filters used
ListBlockDevice lists the block device from etcd based on
the filters used
// ListBlockDevice lists the block device from etcd based on // the filters used
func (cl *Client) ListBlockDevice(filters ...interface{}) ([]blockdevice.BlockDevice, error) {
	bdList := &v1alpha1.BlockDeviceList{
		TypeMeta: metav1.TypeMeta{
			Kind:       "BlockDevice",
			APIVersion: "openebs.io/v1alpha1",
		},
	}
	listOpts := []client.ListOption{
		client.InNamespace(cl.namespace),
	}
	for _, filter := range filters {
		opts := filter.(client.ListOption)
		listOpts = append(listOpts, opts)
	}
	err := cl.client.List(context.TODO(), bdList, listOpts...)
	if err != nil {
		klog.Error("error in listing BDs. ", err)
		return nil, err
	}
	blockDeviceList := make([]blockdevice.BlockDevice, 0)
	err = convertBlockDeviceAPIListToBlockDeviceList(bdList, &blockDeviceList)
	if err != nil {
		return blockDeviceList, err
	}
	klog.V(4).Infof("no of blockdevices listed : %d", len(blockDeviceList))
	return blockDeviceList, nil
}
func ( cl * Client ) ListBlockDevice ( filters ... interface { } ) ( [ ] blockdevice . BlockDevice , error ) { bdList := & v1alpha1 . BlockDeviceList { TypeMeta : metav1 . TypeMeta { Kind : " " , APIVersion : " " , } , } listOpts := [ ] client . ListOption { client . InNamespace ( cl . namespace ) , } for _ , filter := range filters { opts := filter . ( client . ListOption ) listOpts = append ( listOpts , opts ) } err := cl . client . List ( context . TODO ( ) , bdList , listOpts ... ) if err != nil { klog . Error ( " " , err ) return nil , err } blockDeviceList := make ( [ ] blockdevice . BlockDevice , 0 ) err = convertBlockDeviceAPIListToBlockDeviceList ( bdList , & blockDeviceList ) if err != nil { return blockDeviceList , err } klog . V ( 4 ) . Infof ( " " , len ( blockDeviceList ) ) return blockDeviceList , nil }
ListBlockDevice lists the block device from etcd based on
the filters used
ListBlockDevice lists the block device from etcd based on the filters used
// list only from this namespace // convert the filter interface to relevant list option