code: def update(gandi, resource, cmdline, kernel, name, size,
             snapshotprofile, delete_snapshotprofile, background):
      
      if snapshotprofile and delete_snapshotprofile:
          raise UsageError('You must not set snapshotprofile and '
                           'delete-snapshotprofile.')
  
      if delete_snapshotprofile:
          snapshotprofile = ''
  
      if kernel:
          source_info = gandi.disk.info(resource)
          available = gandi.kernel.is_available(source_info, kernel)
          if not available:
              raise UsageError('Kernel %s is not available for disk %s' %
                               (kernel, resource))
  
      result = gandi.disk.update(resource, name, size, snapshotprofile,
                                 background, cmdline, kernel)
      if background:
          gandi.pretty_echo(result)
  
      return result
docs: Update a disk.
  
      Resource can be a disk name, or ID