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.
    """
        return models.ModelsClient().List()
Exemplo n.º 2
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.
    """
    project_ref = resources.REGISTRY.Parse(
        properties.VALUES.core.project.Get(required=True),
        collection='ml.projects')
    return models.ModelsClient().List(project_ref)
Exemplo n.º 3
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.
    """
        client = models.ModelsClient()
        op = client.Delete(args.model)

        return operations.OperationsClient().WaitForOperation(
            op, message='Deleting model [{}]'.format(args.model)).response
Exemplo n.º 4
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.
    """
        regions = args.regions
        if regions is None:
            log.warn(
                '`--regions` flag will soon be required. Please explicitly '
                'specify a region. Using [us-central1] by default.')
            regions = ['us-central1']
        return models.ModelsClient().Create(args.model, regions)
Exemplo n.º 5
0
 def Run(self, args):
   models_client = models.ModelsClient('v1beta1')
   operations_client = operations.OperationsClient('v1beta1')
   return models_util.Delete(models_client, operations_client, args.model)
Exemplo n.º 6
0
 def Run(self, args):
     return models.ModelsClient('v1').Get(args.model)
Exemplo n.º 7
0
 def Run(self, args):
     return models_util.List(models.ModelsClient('v1'))
Exemplo n.º 8
0
 def Run(self, args):
   models_util.Create(models.ModelsClient('v1'), args.model,
                      regions=args.regions, enable_logging=args.enable_logging)