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
示例#2
0
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')
示例#3
0
 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)
示例#4
0
 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')
示例#5
0
 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)
示例#7
0
 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)
示例#9
0
def _Run(args):
    region = region_util.GetRegion(args)
    with endpoint_util.MlEndpointOverrides(region=region):
        return models_util.GetIamPolicy(models.ModelsClient(), args.model)
示例#10
0
 def Run(self, args):
   return models_util.GetIamPolicy(models.ModelsClient(), args.model)
示例#11
0
def _Run(args):
  region = region_util.GetRegion(args)
  with endpoint_util.MlEndpointOverrides(region=region):
    return models_util.List(models.ModelsClient())
示例#12
0
 def Run(self, args):
     with endpoint_util.MlEndpointOverrides(region=args.region):
         return models_util.GetIamPolicy(models.ModelsClient(), args.model)
示例#13
0
def _Run(args):
    with endpoint_util.MlEndpointOverrides(region=args.region):
        return models_util.AddIamPolicyBinding(models.ModelsClient(),
                                               args.model, args.member,
                                               args.role)
示例#14
0
 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')
示例#15
0
 def Run(self, args):
     return models.ModelsClient('v1beta1').Get(args.model)
示例#16
0
def _Run(args):
    with endpoint_util.MlEndpointOverrides(region=args.region):
        return models_util.SetIamPolicy(models.ModelsClient(), args.model,
                                        args.policy_file)
示例#17
0
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)
示例#18
0
 def Run(self, args):
     return models.ModelsClient().Get(args.model)
示例#19
0
 def Run(self, args):
   models_client = models.ModelsClient()
   operations_client = operations.OperationsClient()
   return models_util.Delete(models_client, operations_client, args.model)
示例#20
0
 def Run(self, args):
     return models_util.List(models.ModelsClient())
示例#21
0
 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())
示例#23
0
 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)
示例#25
0
 def Run(self, args):
     models_util.Create(models.ModelsClient('v1'),
                        args.model,
                        regions=args.regions,
                        enable_logging=args.enable_logging)
示例#26
0
 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)
示例#27
0
def _Run(args):
  with endpoint_util.MlEndpointOverrides(region=args.region):
    return models.ModelsClient().Get(args.model)
示例#28
0
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)
示例#29
0
 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')
示例#30
0
 def Run(self, args):
     with endpoint_util.MlEndpointOverrides(region=args.region):
         return models_util.List(models.ModelsClient())