Ejemplo n.º 1
0
 def Args(parser):
     channel_arg = resource_args.CreateNotificationChannelResourceArg(
         'channel', 'to update')
     resource_args.AddResourceArgs(parser, [channel_arg])
     flags.AddMessageFlags(parser, 'channel-content')
     flags.AddFieldsFlagsWithMutuallyExclusiveSettings(
         parser,
         fields_help='The list of fields to update. Must specify '
         '`--channel-content` or `--channel-content-from-file` '
         'if using this flag.',
         add_settings_func=flags.AddNotificationChannelSettingFlags,
         update=True)
Ejemplo n.º 2
0
 def Args(parser):
   resources = [
       resource_args.CreateAlertPolicyResourceArg('to be updated.')]
   resource_args.AddResourceArgs(parser, resources)
   flags.AddMessageFlags(parser, 'policy')
   flags.AddFieldsFlagsWithMutuallyExclusiveSettings(
       parser,
       fields_help=('The list of fields to update. Must specify `--policy` or '
                    '`--policy-from-file` if using this flag.'),
       add_settings_func=flags.AddPolicySettingsFlags,
       fields_choices=['disabled', 'notificationChannels'],
       update=True)
Ejemplo n.º 3
0
    def Args(parser):
        flags.AddMessageFlags(parser, 'policy')
        flags.AddPolicySettingsFlags(parser)
        flags.AddConditionSettingsFlags(parser)
        channels_resource_arg = resource_args.CreateNotificationChannelResourceArg(
            arg_name='--notification-channels',
            extra_help="""\
            to be added to the policy. These should be the resource names (not
            the display name) of the channels. Acceptable formats are:

            * Channel Name: `my-channel`
              * The project specified through `--project` or the default
                project defined by the `core/project` property will be used,
                in that order.
            * Channel Relative Name:
                `projects/my-project/notificationChannels/channel-id0
            * Channel URI:
                https://monitoring.googleapis.com/v3/projects/my-project/notificationChannels/channel-id0
            """,
            required=False,
            plural=True)
        resource_args.AddResourceArgs(parser, [channels_resource_arg])
Ejemplo n.º 4
0
 def Args(parser):
     condition_arg = resource_args.CreateAlertPolicyResourceArg(
         'to add a condition to.')
     resource_args.AddResourceArgs(parser, [condition_arg])
     flags.AddMessageFlags(parser, 'condition')
     flags.AddConditionSettingsFlags(parser)
Ejemplo n.º 5
0
 def Args(parser):
   condition_arg = resource_args.CreateConditionResourceArg('delete')
   resource_args.AddResourceArgs(parser, [condition_arg])
Ejemplo n.º 6
0
 def Args(parser):
   condition_arg = resource_args.CreateConditionResourceArg('update')
   resource_args.AddResourceArgs(parser, [condition_arg])
   flags.AddDisplayNameFlag(parser, 'Condition')
   flags.AddUpdateableConditionFlags(parser)