def Run(self, args):
    """This is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Some value that we want to have printed later.
    """
    op = instances.Upgrade(args.instance)
    if args.async_:
      result = op
    else:
      op_ref = resources.REGISTRY.ParseRelativeName(
          op.name, collection='bigtableadmin.operations')
      message = 'Upgrading bigtable instance {0}'.format(args.instance)
      result = util.AwaitInstance(op_ref, message)

    log.UpdatedResource(args.instance, kind='instance', is_async=args.async_)
    return result
 def testUpgrade(self):
     response = self.msgs.Operation()
     self.ExpectInstanceUpdateRequest(response)
     self.assertEqual(instances.Upgrade('my-instance'), response)