예제 #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()
예제 #2
0
파일: list.py 프로젝트: mzha/HomewardBound
  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)
예제 #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
예제 #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)
예제 #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)
예제 #6
0
 def Run(self, args):
     return models.ModelsClient('v1').Get(args.model)
예제 #7
0
 def Run(self, args):
     return models_util.List(models.ModelsClient('v1'))
예제 #8
0
 def Run(self, args):
   models_util.Create(models.ModelsClient('v1'), args.model,
                      regions=args.regions, enable_logging=args.enable_logging)