Exemplo 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)
Exemplo n.º 2
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])