예제 #1
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])
예제 #2
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)