Exemplo n.º 1
0
  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.Patch(
        args.instance, description=args.description, nodes=args.nodes)
    if args.async:
      return op
    instance_operations.Await(op, 'Updating instance')
Exemplo n.º 2
0
 def testPatch(self):
     response = self.msgs.Operation()
     ref = resources.REGISTRY.Parse('insId',
                                    params={'projectsId': self.Project()},
                                    collection='spanner.projects.instances')
     self.client.projects_instances.Patch.Expect(
         request=self.msgs.SpannerProjectsInstancesPatchRequest(
             name=ref.RelativeName(),
             updateInstanceRequest=self.msgs.UpdateInstanceRequest(
                 fieldMask='displayName,nodeCount',
                 instance=self.msgs.Instance(displayName='name',
                                             nodeCount=3))),
         response=response)
     self.assertEqual(instances.Patch('insId', description='name', nodes=3),
                      response)