def GetRuntimeVersion(model=None, version=None): if version: version_ref = ParseModelOrVersionRef(model, version) version_data = versions_api.VersionsClient().Get(version_ref) else: version_data = models.ModelsClient().Get(model).defaultVersion return version_data.framework, version_data.runtimeVersion
def _Run(args): region = region_util.GetRegion(args) with endpoint_util.MlEndpointOverrides(region=region): models_client = models.ModelsClient() operations_client = operations.OperationsClient() models_util.Update(models_client, operations_client, args) log.UpdatedResource(args.model, kind='ai platform model')
def Run(self, args): with endpoint_util.MlEndpointOverrides(region=args.region): condition = iam_util.ValidateAndExtractCondition(args) iam_util.ValidateMutexConditionAndPrimitiveRoles( condition, args.role) return models_util.AddIamPolicyBindingWithCondition( models.ModelsClient(), args.model, args.member, args.role, condition)
def Run(self, args): models_client = models.ModelsClient() labels = models_util.ParseCreateLabels(models_client, args) model = models_util.Create(models_client, args.model, regions=args.regions, enable_logging=args.enable_logging, labels=labels) log.CreatedResource(model.name, kind='ml engine model')
def _Run(self, args, support_console_logging=False): models_client = models.ModelsClient() labels = models_util.ParseCreateLabels(models_client, args) enable_console_logging = (support_console_logging and args.enable_console_logging) model = models_util.Create(models_client, args.model, regions=args.regions, enable_logging=args.enable_logging, enable_console_logging=enable_console_logging, labels=labels, description=args.description) log.CreatedResource(model.name, kind='ml engine model')
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: The specified function with its description and configured filter. """ with endpoint_util.MlEndpointOverrides(region=args.region): client = models.ModelsClient() return models_util.RemoveIamPolicyBinding(client, args.model, args.member, args.role)
def _Run(self, args, support_console_logging=False): region, model_regions = models_util.GetModelRegion(args) with endpoint_util.MlEndpointOverrides(region=region): models_client = models.ModelsClient() labels = models_util.ParseCreateLabels(models_client, args) enable_console_logging = (support_console_logging and args.enable_console_logging) model = models_util.Create( models_client, args.model, model_regions, enable_logging=args.enable_logging, enable_console_logging=enable_console_logging, labels=labels, description=args.description) log.CreatedResource(model.name, kind='ai platform model')
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: The specified function with its description and configured filter. """ with endpoint_util.MlEndpointOverrides(region=args.region): condition = iam_util.ValidateAndExtractCondition(args) iam_util.ValidateMutexConditionAndPrimitiveRoles( condition, args.role) return models_util.RemoveIamPolicyBindingWithCondition( models.ModelsClient(), args.model, args.member, args.role, condition)
def _Run(args): region = region_util.GetRegion(args) with endpoint_util.MlEndpointOverrides(region=region): return models_util.GetIamPolicy(models.ModelsClient(), args.model)
def Run(self, args): return models_util.GetIamPolicy(models.ModelsClient(), args.model)
def _Run(args): region = region_util.GetRegion(args) with endpoint_util.MlEndpointOverrides(region=region): return models_util.List(models.ModelsClient())
def Run(self, args): with endpoint_util.MlEndpointOverrides(region=args.region): return models_util.GetIamPolicy(models.ModelsClient(), args.model)
def _Run(args): with endpoint_util.MlEndpointOverrides(region=args.region): return models_util.AddIamPolicyBinding(models.ModelsClient(), args.model, args.member, args.role)
def Run(self, args): with endpoint_util.MlEndpointOverrides(region=args.region): models_client = models.ModelsClient() operations_client = operations.OperationsClient() models_util.Update(models_client, operations_client, args) log.UpdatedResource(args.model, kind='ml engine model')
def Run(self, args): return models.ModelsClient('v1beta1').Get(args.model)
def _Run(args): with endpoint_util.MlEndpointOverrides(region=args.region): return models_util.SetIamPolicy(models.ModelsClient(), args.model, args.policy_file)
def _Run(args): region = region_util.GetRegion(args) with endpoint_util.MlEndpointOverrides(region=region): models_client = models.ModelsClient() operations_client = operations.OperationsClient() return models_util.Delete(models_client, operations_client, args.model)
def Run(self, args): return models.ModelsClient().Get(args.model)
def Run(self, args): models_client = models.ModelsClient() operations_client = operations.OperationsClient() return models_util.Delete(models_client, operations_client, args.model)
def Run(self, args): return models_util.List(models.ModelsClient())
def Run(self, args): model = models_util.Create(models.ModelsClient(), args.model, regions=args.regions, enable_logging=args.enable_logging) log.CreatedResource(model.name, kind='ml engine model')
def SetUp(self): self.models_client = models.ModelsClient() self.model_ref = resources.REGISTRY.Create( models_util.MODELS_COLLECTION, modelsId='myModel', projectsId=self.Project())
def Run(self, args): return models_util.SetIamPolicy(models.ModelsClient(), args.model, args.policy_file)
def Run(self, args): return models_util.AddIamPolicyBinding(models.ModelsClient(), args.model, args.member, args.role)
def Run(self, args): models_util.Create(models.ModelsClient('v1'), args.model, regions=args.regions, enable_logging=args.enable_logging)
def Run(self, args): with endpoint_util.MlEndpointOverrides(region=args.region): models_client = models.ModelsClient() operations_client = operations.OperationsClient() return models_util.Delete(models_client, operations_client, args.model)
def _Run(args): with endpoint_util.MlEndpointOverrides(region=args.region): return models.ModelsClient().Get(args.model)
def _Run(args): region = region_util.GetRegion(args) with endpoint_util.MlEndpointOverrides(region=region): client = models.ModelsClient() return models_util.RemoveIamPolicyBinding(client, args.model, args.member, args.role)
def Run(self, args): models_client = models.ModelsClient() operations_client = operations.OperationsClient() models_util.Update(models_client, operations_client, args) log.UpdatedResource(args.model, kind='ml engine model')
def Run(self, args): with endpoint_util.MlEndpointOverrides(region=args.region): return models_util.List(models.ModelsClient())