code: def cli(env, identifier, cpu, private, memory, network, flavor):
      
  
      vsi = SoftLayer.VSManager(env.client)
  
      if not any([cpu, memory, network, flavor]):
          raise exceptions.ArgumentError("Must provide [--cpu], [--memory], [--network], or [--flavor] to upgrade")
  
      if private and not cpu:
          raise exceptions.ArgumentError("Must specify [--cpu] when using [--private]")
  
      vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')
      if not (env.skip_confirmations or formatting.confirm("This action will incur charges on your account. Continue?")):
          raise exceptions.CLIAbort('Aborted')
  
      if memory:
          memory = int(memory / 1024)
  
      if not vsi.upgrade(vs_id, cpus=cpu, memory=memory, nic_speed=network, public=not private, preset=flavor):
          raise exceptions.CLIAbort('VS Upgrade Failed')
docs: Upgrade a virtual server.