Ejemplo n.º 1
0
 def addVolume(cls, token, args):
     volumeList = VolumeList(token)
     volId = volumeList.add(
         args.size,
         name=args.name,
         description=args.description,
         source=args.source,
         snapshotId=args.snapshotId,
         imageRef=args.image_ref,
         bootable=args.bootable,
     )
     if not args.quiet:
         yield ['ID']
         yield [volId]
Ejemplo n.º 2
0
	def addVolume(cls, token, args):
		volumeList = VolumeList(token)
		volId = volumeList.add(
				args.size,
				name=args.name,
				description=args.description,
				source=args.source,
				snapshotId=args.snapshotId,
				imageRef=args.image_ref,
				bootable=args.bootable,
				)
		if not args.quiet:
			yield ['ID']
			yield [volId]
Ejemplo n.º 3
0
 def listVolumes(cls, token, args):
     volumeList = VolumeList(token)
     # Header
     if args.verbose:
         yield [
             'ID', 'Name', 'Size', 'Bootable', 'Encrypted', 'Description',
             'Metadata'
         ]
     else:
         yield [
             'ID', 'Name', 'Size', 'Bootable', 'Encrypted', 'Description'
         ]
     # Body
     for volume in volumeList:
         if args.verbose:
             yield [
                 volume.volumeId, volume.name, volume.size, volume.bootable,
                 volume.encrypted, volume.description, volume.metadata
             ]
         else:
             yield [
                 volume.volumeId, volume.name, volume.size, volume.bootable,
                 volume.encrypted, volume.description
             ]
Ejemplo n.º 4
0
 def deleteVolume(cls, token, args):
     volumeList = VolumeList(token)
     vol = volumeList[args.id or args.name]
     volumeList.delete(vol.volumeId)
Ejemplo n.º 5
0
	def deleteVolume(cls, token, args):
		volumeList = VolumeList(token)
		vol = volumeList[args.id or args.name]
		volumeList.delete(vol.volumeId)