Exemplo n.º 1
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument('--location',
                            metavar='LOCATION',
                            required=True,
                            help='Location')
        parser.add_argument(
            '--recommender',
            metavar='RECOMMENDER',
            required=True,
            help=
            ('Recommender to list recommendations for. Supported recommenders '
             'can be found here: '
             'https://cloud.google.com/recommender/docs/recommenders'))
        parser.display_info.AddFormat("""
        table(
          name.basename(): label=RECOMMENDATION_ID,
          primaryImpact.category: label=PRIMARY_IMPACT_CATEGORY,
          stateInfo.state: label=RECOMMENDATION_STATE,
          lastRefreshTime: label=LAST_REFRESH_TIME,
          priority: label=PRIORITY,
          recommenderSubtype: label=RECOMMENDER_SUBTYPE,
          description: label=DESCRIPTION
        )
    """)
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument(
            'INSIGHT',
            type=str,
            help='Insight id which will be marked as accepted',
        )
        parser.add_argument('--location',
                            metavar='LOCATION',
                            required=True,
                            help='Location')
        parser.add_argument('--insight-type',
                            metavar='INSIGHT_TYPE',
                            required=True,
                            help='Insight Type of the insights')
        parser.add_argument('--etag',
                            required=True,
                            metavar='etag',
                            help='Etag of a insight')
        parser.add_argument(
            '--state-metadata',
            type=arg_parsers.ArgDict(min_length=1),
            default={},
            help=
            'State metadata for recommendation, in format of --state-metadata=key1=value1,key2=value2',
            metavar='KEY=VALUE',
            action=arg_parsers.StoreOnceAction)
Exemplo n.º 3
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument(
            'RECOMMENDATION',
            type=str,
            help='Recommendation id which will be marked as FAILED.')
        parser.add_argument('--location',
                            metavar='LOCATION',
                            required=True,
                            help='Location.')
        parser.add_argument('--recommender',
                            metavar='RECOMMENDER',
                            required=True,
                            help='Recommender of recommendation.')
        parser.add_argument('--etag',
                            metavar='ETAG',
                            required=True,
                            help='Etag of a recommendation.')
        parser.add_argument(
            '--state-metadata',
            type=arg_parsers.ArgDict(min_length=1),
            default={},
            help=
            'State metadata for recommendation, in format of --state-metadata=key1=value1,key2=value2',
            metavar='KEY=VALUE',
            action=arg_parsers.StoreOnceAction)
Exemplo n.º 4
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument(
            'INSIGHT',
            type=str,
            help='Insight id which will be marked as dismissed',
        )
        parser.add_argument('--location', metavar='LOCATION', help='Location')
        parser.add_argument('--recommendation-change-type',
                            metavar='Recommendation change type',
                            choices=['dismiss', 'leave_unchanged'],
                            help='Recommendation change type')
        parser.add_argument('--insight-type',
                            metavar='Insight Type',
                            help='Insight Type of the insights')
        parser.add_argument('--etag',
                            required=True,
                            metavar='etag',
                            help='Etag of a insight')
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
    flags.AddParentFlagsToParser(parser)
    parser.add_argument(
        'RECOMMENDATION',
        type=str,
        help='Recommendation id which will be marked as dismissed',
    )
    parser.add_argument(
        '--location', metavar='LOCATION', required=True, help='Location')
    parser.add_argument(
        '--recommender',
        metavar='RECOMMENDER',
        required=True,
        help='Recommender of the recommendations')
    parser.add_argument(
        '--etag',
        required=True,
        metavar='ETAG',
        help='Etag of a recommendation')
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
    flags.AddParentFlagsToParser(parser)
    parser.add_argument(
        '--location', metavar='LOCATION', required=True, help='Location')
    parser.add_argument(
        '--insight-type',
        metavar='INSIGHT_TYPE',
        required=True,
        help=(
            'Insight type to list insights for. Supported insight-types can '
            'be found here: '
            'https://cloud.google.com/recommender/docs/insights/insight-types'))
    parser.display_info.AddFormat("""
        table(
          name.basename(): label=INSIGHT_ID,
          category: label=CATEGORY,
          stateInfo.state: label=INSIGHT_STATE,
          lastRefreshTime: label=LAST_REFRESH_TIME,
          severity: label=SEVERITY,
          insightSubtype: label=INSIGHT_SUBTYPE,
          description: label=DESCRIPTION
        )
    """)
Exemplo n.º 7
0
 def SetUp(self):
     self.parser = calliope_util.ArgumentParser()
     flags.AddParentFlagsToParser(self.parser)
     self.parser.add_argument('--location',
                              metavar='LOCATION',
                              help='Location')
     self.parser.add_argument('--recommender',
                              metavar='RECOMMENDER',
                              help='Recommender of recommendation')
     self.parser.add_argument('--insight-type',
                              metavar='Insight Type',
                              help='Insight Type of the insights')
Exemplo n.º 8
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument(
            'INSIGHT',
            type=str,
            help='insight to describe',
        )
        parser.add_argument('--location', metavar='LOCATION', help='Location')
        parser.add_argument('--insight-type',
                            metavar='INSIGHT_TYPE',
                            required=True,
                            help='Insight type to describe insights')
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
    flags.AddParentFlagsToParser(parser)
    parser.add_argument(
        'INSIGHT',
        type=str,
        help='Insight id which will be marked as active',
    )
    parser.add_argument(
        '--location', metavar='LOCATION', required=True, help='Location')
    parser.add_argument(
        '--insight-type',
        metavar='INSIGHT_TYPE',
        required=True,
        help='Insight Type of the insights')
    parser.add_argument(
        '--etag', required=True, metavar='etag', help='Etag of a insight')
Exemplo n.º 10
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument('--location', metavar='LOCATION', help='Location')
        parser.add_argument('--recommender',
                            metavar='RECOMMENDER',
                            required=True,
                            help='Recommender to list recommendations for')
        parser.display_info.AddFormat("""
        table(
          name.basename(): label=RECOMMENDATION_ID,
          name.segment(3): label=LOCATION,
          name.segment(5): label=RECOMMENDER,
          primaryImpact.category: label=PRIMARY_IMPACT_CATEGORY,
          stateInfo.state: label=RECOMMENDATION_STATE,
          lastRefreshTime: label=LAST_REFRESH_TIME
        )
    """)
Exemplo n.º 11
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    """
        flags.AddParentFlagsToParser(parser)
        parser.add_argument('--location', metavar='LOCATION', help='Location')
        parser.add_argument('--insight-type',
                            metavar='INSIGHT_TYPE',
                            required=True,
                            help='Insight type to list insights for')
        parser.display_info.AddFormat("""
        table(
          name.basename(): label=INSIGHT_ID,
          name.segment(3): label=LOCATION,
          name.segment(5): label=INSIGHT_TYPE,
          category: label=CATEGORY,
          stateInfo.state: label=INSIGHT_STATE,
          lastRefreshTime: label=LAST_REFRESH_TIME
        )
    """)