コード例 #1
0
  def Args(parser):
    base.URI_FLAG.RemoveFromParser(parser)
    # TODO(b/191296541): Use built-in filter arg after it is supported by
    # backend.
    # Filter is not supported yet.
    base.FILTER_FLAG.RemoveFromParser(parser)
    # Temporarily add a fake hidden implementation so that no parsing logic
    # needs to be changed.
    parser.add_argument(
        '--filter',
        hidden=True,
        metavar='EXPRESSION',
        require_coverage_in_tests=False,
        help="""\
        Apply a Boolean filter EXPRESSION to each resource item to be listed
        (the '=' equality operator is the only supported operator).
        If the expression evaluates true for an item, the item is listed.
        This flag interacts with other flags, which are applied in the
        following order: *--flatten*, *--sort-by*, *--filter*, *--limit*.
        For more information, run 'gcloud topic filters'.""")

    flags.AddRegionFlag(parser)
    parser.display_info.AddFormat("""
          table(
            name.basename():label=BATCH_ID,
            batchType.yesno(no="-"):label=JOB_TYPE,
            state:label=STATUS
          )
    """)
コード例 #2
0
ファイル: list.py プロジェクト: Guliux10/bchacks_deepbreath
 def Args(parser):
     flags.AddRegionFlag(parser)
     base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)
     parser.display_info.AddFormat("""
       table(
         id:label=ID
       )
 """)
     # Implementation of --uri prints out "name" field for each entry
     parser.display_info.AddUriFunc(lambda resource: resource.name)
コード例 #3
0
    def Args(cls, parser):
        parser.add_argument('--file',
                            help="""
        The path to a YAML file containing a Dataproc Cluster resource.

        For more information, see:
        https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.clusters#Cluster.
        """,
                            required=True)
        # TODO(b/80197067): Move defaults to a common location.
        flags.AddTimeoutFlag(parser, default='35m')
        flags.AddRegionFlag(parser)
        base.ASYNC_FLAG.AddToParser(parser)
コード例 #4
0
 def Args(parser):
     # TODO(b/65634121): Implement URI listing for dataproc
     base.URI_FLAG.RemoveFromParser(parser)
     base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)
     flags.AddRegionFlag(parser)
     parser.display_info.AddFormat("""
       table(
         id:label=ID,
         jobs.len():label=JOBS,
         updateTime:label=UPDATE_TIME,
         version:label=VERSION
       )
 """)
コード例 #5
0
ファイル: list.py プロジェクト: Guliux10/bchacks_deepbreath
 def Args(parser):
     flags.AddRegionFlag(parser)
     base.URI_FLAG.RemoveFromParser(parser)
     base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)
     parser.display_info.AddFormat("""
       table(
         clusterName:label=NAME,
         config.workerConfig.numInstances:label=WORKER_COUNT,
         config.secondaryWorkerConfig.numInstances:label=PREEMPTIBLE_WORKER_COUNT,
         status.state:label=STATUS,
         config.gceClusterConfig.zoneUri.scope(zone):label=ZONE,
         config.lifecycleConfig.yesno(yes=enabled, no=''):label=SCHEDULED_DELETE
       )
 """)
コード例 #6
0
    def Args(parser):
        # Allow user specified Job ID, but don't expose it.
        parser.add_argument(
            '--id',
            hidden=True,
            help='Set the ID of the job, which is usually autogenerated')

        flags.AddRegionFlag(parser)

        base.ASYNC_FLAG.AddToParser(parser)

        parser.add_argument(
            '--bucket',
            help=(
                "The Cloud Storage bucket to stage files in. Defaults to the "
                "cluster's configured bucket."))
コード例 #7
0
    def Args(parser):
        base.URI_FLAG.RemoveFromParser(parser)
        base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)
        flags.AddRegionFlag(parser)

        parser.add_argument(
            '--cluster', help='Restrict to the jobs of this Dataproc cluster.')

        parser.add_argument('--state-filter',
                            choices=sorted(STATE_MATCHER_ENUM_MAP.keys()),
                            help='Filter by job state.')
        parser.display_info.AddFormat("""
          table(
            reference.jobId,
            type.yesno(no="-"),
            status.state:label=STATUS
          )
    """)
コード例 #8
0
 def Args(parser):
     flags.AddRegionFlag(parser)
     base.URI_FLAG.RemoveFromParser(parser)
     base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)
     parser.display_info.AddFormat("""
       table(
         clusterName:label=NAME,
         config.gkeClusterConfig.yesno(yes=GKE, no=GCE):label=PLATFORM,
         config.workerConfig.numInstances:label=WORKER_COUNT,
         config.secondaryWorkerConfig.numInstances:label=PREEMPTIBLE_WORKER_COUNT,
         status.state:label=STATUS,
         config.firstof(
             gkeClusterConfig.namespacedGkeDeploymentTarget.targetGkeCluster,
             gceClusterConfig.zoneUri
           ).scope('locations'):label=ZONE,
         config.lifecycleConfig.yesno(yes=enabled, no=''):label=SCHEDULED_DELETE
       )
 """)
コード例 #9
0
  def Args(parser):
    base.URI_FLAG.RemoveFromParser(parser)
    base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)

    flags.AddRegionFlag(parser)

    parser.add_argument(
        '--cluster',
        help=('Restrict to the operations of this Dataproc cluster. This flag '
              'is ignored when --filter is specified. The equivalent term in '
              'a --filter expression is: `clusterName = myclustername`'))

    parser.add_argument(
        '--state-filter',
        choices=sorted(STATE_MATCHER_MAP.keys()),
        help=('Filter by cluster state. This flag is ignored when --filter '
              'is specified. The equivalent term in a --filter expression is: '
              '`status.state = ACTIVE`'))

    flags.AddListOperationsFormat(parser)
コード例 #10
0
 def Args(cls, parser):
   flags.AddRegionFlag(parser)
   flags.AddFileFlag(parser, 'workflow template', 'run')
   base.ASYNC_FLAG.AddToParser(parser)