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()
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)
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
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)
def Run(self, args): models_client = models.ModelsClient('v1beta1') operations_client = operations.OperationsClient('v1beta1') return models_util.Delete(models_client, operations_client, args.model)
def Run(self, args): return models.ModelsClient('v1').Get(args.model)
def Run(self, args): return models_util.List(models.ModelsClient('v1'))
def Run(self, args): models_util.Create(models.ModelsClient('v1'), args.model, regions=args.regions, enable_logging=args.enable_logging)