示例#1
0
def register_attributes_argument(scope, name, attr_class, create=False):
    register_cli_argument(scope,
                          '{}_attributes'.format(name),
                          ignore_type,
                          validator=get_attribute_validator(
                              name, attr_class, create))
    if create:
        register_extra_cli_argument(
            scope,
            'disabled',
            help='Create {} in disabled state.'.format(name),
            **three_state_flag())
    else:
        register_extra_cli_argument(scope,
                                    'enabled',
                                    help='Enable the {}.'.format(name),
                                    **three_state_flag())
    register_extra_cli_argument(
        scope,
        'expires',
        default=None,
        help='Expiration UTC datetime  (Y-m-d\'T\'H:M:S\'Z\').',
        type=datetime_type)
    register_extra_cli_argument(
        scope,
        'not_before',
        default=None,
        help=
        'Key not usable before the provided UTC datetime  (Y-m-d\'T\'H:M:S\'Z\').',
        type=datetime_type)
示例#2
0
def register_attributes_argument(scope, name, attr_class, create=False, ignore=None):
    ignore = ignore or []
    register_cli_argument(scope, '{}_attributes'.format(name), ignore_type,
                          validator=get_attribute_validator(name, attr_class, create))
    if create:
        register_extra_cli_argument(scope, 'disabled',
                                    help='Create {} in disabled state.'.format(name),
                                    **three_state_flag())
    else:
        register_extra_cli_argument(scope, 'enabled', help='Enable the {}.'.format(name),
                                    **three_state_flag())
    if 'expires' not in ignore:
        register_extra_cli_argument(scope, 'expires', default=None,
                                    help='Expiration UTC datetime  (Y-m-d\'T\'H:M:S\'Z\').',
                                    type=datetime_type)
    if 'not_before' not in ignore:
        register_extra_cli_argument(scope, 'not_before', default=None,
                                    help='Key not usable before the provided UTC datetime  '
                                         '(Y-m-d\'T\'H:M:S\'Z\').',
                                    type=datetime_type)
示例#3
0
               help='The type of the server key',
               **enum_choice_list(ServerKeyType))


#####
#           sql server vnet-rule
#####


with ParametersContext(command='sql server vnet-rule') as c:
    # Help text needs to be specified because 'sql server vnet-rule create' is a custom
    # command.
    c.argument('server_name',
               options_list=('--server', '-s'), completer=get_resource_name_completion_list('Microsoft.SQL/servers'))

    c.argument('virtual_network_rule_name',
               options_list=('--name', '-n'))

    c.argument('virtual_network_subnet_id',
               options_list=('--subnet'),
               help='Name or ID of the subnet that allows access to an Azure Sql Server. '
               'If subnet name is provided, --vnet-name must be provided.')

    c.argument('ignore_missing_vnet_service_endpoint',
               options_list=('--ignore-missing-endpoint', '-i'),
               help='Create firewall rule before the virtual network has vnet service endpoint enabled',
               **three_state_flag())

register_extra_cli_argument('sql server vnet-rule create', 'vnet_name', options_list=('--vnet-name'),
                            help='The virtual network name', validator=validate_subnet)
示例#4
0
register_cli_argument('keyvault', 'resource_group_name', resource_group_name_type, id_part=None,
                      required=False,
                      help='Proceed only if Key Vault belongs to the specified resource group.',
                      validator=validate_resource_group_name)
register_cli_argument('keyvault', 'vault_name', vault_name_type, options_list=('--name', '-n'))
register_cli_argument('keyvault', 'object_id',
                      help='a GUID that identifies the principal that will receive permissions')
register_cli_argument('keyvault', 'spn',
                      help='name of a service principal that will receive permissions')
register_cli_argument('keyvault', 'upn',
                      help='name of a user principal that will receive permissions')
register_cli_argument('keyvault', 'tags', tags_type)
register_cli_argument('keyvault', 'enabled_for_deployment',
                      help='Allow Virtual Machines to retrieve certificates stored as secrets from '
                           'the vault.',
                      **three_state_flag())
register_cli_argument('keyvault', 'enabled_for_disk_encryption',
                      help='Allow Disk Encryption to retrieve secrets from the vault and unwrap '
                           'keys.',
                      **three_state_flag())
register_cli_argument('keyvault', 'enabled_for_template_deployment',
                      help='Allow Resource Manager to retrieve secrets from the vault.',
                      **three_state_flag())

register_cli_argument('keyvault create', 'resource_group_name', resource_group_name_type,
                      required=True, completer=None, validator=None)
register_cli_argument('keyvault create', 'vault_name', completer=None)
register_cli_argument('keyvault create', 'sku', **enum_choice_list(SkuName))
register_cli_argument('keyvault create', 'no_self_perms',
                      help="Don't add permissions for the current user/service principal in the "
                           "new vault",
示例#5
0
    register_extra_cli_argument(command, 'resource_type', options_list=['--{}-type'.format(dest)], arg_group=arg_group, help="Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines)')")


name_arg_type = CliArgumentType(options_list=['--name', '-n'], metavar='NAME')

register_cli_argument('monitor', 'location', location_type, validator=get_default_location_from_resource_group)
register_cli_argument('monitor', 'tags', tags_type)

# region Alerts

register_cli_argument('monitor alert', 'rule_name', name_arg_type, id_part='name', help='Name of the alert rule.')

register_cli_argument('monitor alert create', 'rule_name', name_arg_type, id_part='name', help='Name of the alert rule.')

register_cli_argument('monitor alert create', 'custom_emails', nargs='+', arg_group='Action')
register_cli_argument('monitor alert create', 'disabled', **three_state_flag())
register_cli_argument('monitor alert create', 'email_service_owners', arg_group='Action', **three_state_flag())
register_cli_argument('monitor alert create', 'actions', options_list=['--action', '-a'], action=AlertAddAction, nargs='+', arg_group='Action')
register_cli_argument('monitor alert create', 'condition', action=ConditionAction, nargs='+')
register_cli_argument('monitor alert create', 'metric_name', arg_group='Condition')
register_cli_argument('monitor alert create', 'operator', arg_group='Condition', **enum_choice_list(ConditionOperator))
register_cli_argument('monitor alert create', 'threshold', arg_group='Condition')
register_cli_argument('monitor alert create', 'time_aggregation', arg_group='Condition', **enum_choice_list(TimeAggregationOperator))
register_cli_argument('monitor alert create', 'window_size', arg_group='Condition')
register_resource_parameter('monitor alert create', 'target', 'Target Resource')

register_cli_argument('monitor alert update', 'rule_name', name_arg_type, id_part='name', help='Name of the alert rule.')
register_cli_argument('monitor alert update', 'email_service_owners', arg_group='Action', **three_state_flag())
register_cli_argument('monitor alert update', 'add_actions', options_list=['--add-action', '-a'], nargs='+', action=AlertAddAction, arg_group='Action')
register_cli_argument('monitor alert update', 'remove_actions', options_list=['--remove-action', '-r'], nargs='+', action=AlertRemoveAction, arg_group='Action')
register_cli_argument('monitor alert update', 'condition', action=ConditionAction, nargs='+', arg_group='Condition')
示例#6
0
def register_common_storage_account_options(context):
    context.reg_arg('https_only', help='Allows https traffic only to storage service.', **three_state_flag())
    context.reg_arg('sku', help='The storage account SKU.', **model_choice_list(ResourceType.MGMT_STORAGE, 'SkuName'))
    context.reg_arg('access_tier', help='The access tier used for billing StandardBlob accounts. Cannot be set for '
                                        'StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types. It is '
                                        'required for StandardBlob accounts during creation',
                    **model_choice_list(ResourceType.MGMT_STORAGE, 'AccessTier'))

    # after API 2016-12-01
    if supported_api_version(resource_type=ResourceType.MGMT_STORAGE, min_api='2016-12-01'):
        encryption_services_model = get_sdk(ResourceType.MGMT_STORAGE, 'models#EncryptionServices')
        if encryption_services_model:

            encryption_choices = []
            for attribute in encryption_services_model._attribute_map.keys():  # pylint: disable=protected-access
                if not encryption_services_model._validation.get(attribute, {}).get('readonly'):  # pylint: disable=protected-access
                    # skip readonly attributes, which are not for input
                    encryption_choices.append(attribute)

            context.reg_arg('encryption_services', nargs='+', help='Specifies which service(s) to encrypt.',
                            validator=validate_encryption_services, **enum_choice_list(encryption_choices))

    # after API 2017-06-01
    if supported_api_version(resource_type=ResourceType.MGMT_STORAGE, min_api='2017-06-01'):
        context.reg_arg('assign_identity', action='store_true',
                        help='Generate and assign a new Storage Account Identity for this storage account for use with '
                             'key management services like Azure KeyVault.')

        # the options of encryption key sources are hardcoded since there isn't a enum represents them in the SDK.
        context.reg_arg('encryption_key_source', help='The encryption keySource (provider). Default: Microsoft.Storage',
                        validator=validate_encryption_source,
                        **enum_choice_list(['Microsoft.Storage', 'Microsoft.Keyvault']))
示例#7
0
register_cli_argument('keyvault', 'resource_group_name', resource_group_name_type, id_part=None,
                      required=False,
                      help='Proceed only if Key Vault belongs to the specified resource group.',
                      validator=validate_resource_group_name)
register_cli_argument('keyvault', 'vault_name', vault_name_type, options_list=('--name', '-n'))
register_cli_argument('keyvault', 'object_id',
                      help='a GUID that identifies the principal that will receive permissions')
register_cli_argument('keyvault', 'spn',
                      help='name of a service principal that will receive permissions')
register_cli_argument('keyvault', 'upn',
                      help='name of a user principal that will receive permissions')
register_cli_argument('keyvault', 'tags', tags_type)
register_cli_argument('keyvault', 'enabled_for_deployment',
                      help='Allow Virtual Machines to retrieve certificates stored as secrets from '
                           'the vault.',
                      **three_state_flag())
register_cli_argument('keyvault', 'enabled_for_disk_encryption',
                      help='Allow Disk Encryption to retrieve secrets from the vault and unwrap '
                           'keys.',
                      **three_state_flag())
register_cli_argument('keyvault', 'enabled_for_template_deployment',
                      help='Allow Resource Manager to retrieve secrets from the vault.',
                      **three_state_flag())
register_cli_argument('keyvault', 'enable_soft_delete',
                      help='Enable vault deletion recovery for the vault, and all contained entities',
                      **three_state_flag())

register_cli_argument('keyvault create', 'resource_group_name', resource_group_name_type,
                      required=True, completer=None, validator=None)
register_cli_argument('keyvault create', 'vault_name', completer=None)
register_cli_argument('keyvault create', 'sku', **enum_choice_list(SkuName))
示例#8
0
register_cli_argument(cdn_endpoint, 'location',
                      validator=get_default_location_from_resource_group)
register_cli_argument(cdn_endpoint,
                      'origins',
                      options_list='--origin',
                      nargs='+',
                      action=OriginType,
                      validator=validate_origin,
                      help='Endpoint origin specified by the following space delimited 3 '
                           'tuple: `www.example.com http_port https_port`. The HTTP and HTTPs'
                           'ports are optional and will default to 80 and 443 respectively.')
register_cli_argument(cdn_endpoint, 'is_http_allowed',
                      options_list='--no-http',
                      help='Indicates whether HTTP traffic is not allowed on the endpoint. '
                           'Default is to allow HTTP traffic.',
                      **three_state_flag(invert=True))
register_cli_argument(cdn_endpoint, 'is_https_allowed',
                      options_list='--no-https',
                      help='Indicates whether HTTPS traffic is not allowed on the endpoint. '
                           'Default is to allow HTTPS traffic.',
                      **three_state_flag(invert=True))
register_cli_argument(cdn_endpoint, 'is_compression_enabled',
                      options_list='--enable-compression',
                      help='If compression is enabled, content will be served as compressed if '
                           'user requests for a compressed version. Content won\'t be compressed '
                           'on CDN when requested content is smaller than 1 byte or larger than 1 '
                           'MB.',
                      **three_state_flag())
caching_behavior = [item.value for item in list(QueryStringCachingBehavior)]
register_cli_argument(cdn_endpoint,
                      'query_string_caching_behavior',
示例#9
0
)

register_cli_argument('eventgrid', 'resource_group_name', resource_group_name_type)
register_cli_argument('eventgrid', 'location', location_type)
register_cli_argument('eventgrid', 'tags', tags_type, help="Space separated tags in 'key[=value]' format.")

register_cli_argument('eventgrid', 'endpoint', help="Endpoint where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For eventhub endpoint type, this should be the Azure ResourceID of the event hub.")
register_cli_argument('eventgrid', 'event_subscription_name', help="Name of the event subscription.")
register_cli_argument('eventgrid', 'subject_begins_with', help="An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.")
register_cli_argument('eventgrid', 'subject_ends_with', help="An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.")
register_cli_argument('eventgrid', 'topic_type_name', help="Name of the topic type.")


register_cli_argument('eventgrid topic', 'topic_name', arg_type=name_type, help='Name of the topic', id_part="name")
register_cli_argument('eventgrid topic event-subscription', 'topic_name', options_list=['--topic-name'])
register_cli_argument('eventgrid topic event-subscription', 'event_subscription_name', name_type, help='Name of the event subscription')
register_cli_argument('eventgrid event-subscription', 'event_subscription_name', name_type, help='Name of the event subscription')
register_cli_argument('eventgrid resource event-subscription', 'event_subscription_name', name_type, help='Name of the event subscription')

register_cli_argument('eventgrid', 'is_subject_case_sensitive', options_list=['--subject-case-sensitive'], help="Specify to indicate whether the subject fields should be compared in a case sensitive manner. True if flag present.", **three_state_flag())

register_cli_argument('eventgrid', 'included_event_types', included_event_types_type)
register_cli_argument('eventgrid', 'labels', labels_type)
register_cli_argument('eventgrid', 'endpoint_type', **enum_choice_list(['webhook', 'eventhub']))

register_cli_argument('eventgrid', 'provider_namespace', help="Namespace of the provider owning the resource.")
register_cli_argument('eventgrid', 'resource_type', help="Type of the resource.")
register_cli_argument('eventgrid', 'resource_name', help="Name of the resource whose event subscription needs to be managed.")

register_cli_argument('eventgrid topic-type', 'topic_type_name', name_type)
示例#10
0
register_cli_argument('backup recoverypoint list', 'end_date', type=datetime_type, help='The end date of the range in UTC (d-m-Y).')

register_cli_argument('backup recoverypoint show', 'name', rp_name_type, options_list=('--name', '-n'))

# Protection
register_cli_argument('backup protection', 'vault_name', vault_name_type)
register_cli_argument('backup protection enable-for-vm', 'vm', help='Name or ID of the Virtual Machine to be protected.')
register_cli_argument('backup protection enable-for-vm', 'policy_name', policy_name_type)

for command in ['backup-now', 'disable']:
    register_cli_argument('backup protection {}'.format(command), 'container_name', container_name_type)
    register_cli_argument('backup protection {}'.format(command), 'item_name', item_name_type)

register_cli_argument('backup protection backup-now', 'retain_until', type=datetime_type, help='The date until which this backed up copy will be available for retrieval in UTC (d-m-Y).')

register_cli_argument('backup protection disable', 'delete_backup_data', help='Option to delete the existing backed up data in the recovery services vault.', **three_state_flag())

# Restore
for command in ['restore-disks', 'files']:
    register_cli_argument('backup restore {}'.format(command), 'vault_name', vault_name_type)
    register_cli_argument('backup restore {}'.format(command), 'container_name', container_name_type)
    register_cli_argument('backup restore {}'.format(command), 'item_name', item_name_type)
    register_cli_argument('backup restore {}'.format(command), 'rp_name', rp_name_type)

register_cli_argument('backup restore restore-disks', 'storage_account', help='Name or ID of the storge accout to which the disks are restored.')

# Job
register_cli_argument('backup job', 'vault_name', vault_name_type)

for command in ['show', 'stop', 'wait']:
    register_cli_argument('backup job {}'.format(command), 'name', job_name_type)
示例#11
0
for item in ['check-name', 'delete', 'list', 'show', 'show-usage', 'update', 'keys']:
    register_cli_argument('storage account {}'.format(item), 'account_name', account_name_type, options_list=('--name', '-n'))

register_cli_argument('storage account show-connection-string', 'account_name', account_name_type, options_list=('--name', '-n'))
register_cli_argument('storage account show-connection-string', 'protocol', help='The default endpoint protocol.', **enum_choice_list(['http', 'https']))
register_cli_argument('storage account show-connection-string', 'key_name', options_list=('--key',), help='The key to use.', **enum_choice_list(list(storage_account_key_options.keys())))
for item in ['blob', 'file', 'queue', 'table']:
    register_cli_argument('storage account show-connection-string', '{}_endpoint'.format(item), help='Custom endpoint for {}s.'.format(item))

register_cli_argument('storage account create', 'location', location_type, validator=get_default_location_from_resource_group)
register_cli_argument('storage account create', 'account_type', help='The storage account type', **model_choice_list(ResourceType.MGMT_STORAGE, 'AccountType'))
register_cli_argument('storage account create', 'account_name', account_name_type, options_list=('--name', '-n'), completer=None)
register_cli_argument('storage account create', 'kind', help='Indicates the type of storage account.', default=enum_default(ResourceType.MGMT_STORAGE, 'Kind', 'storage'), **model_choice_list(ResourceType.MGMT_STORAGE, 'Kind'))
register_cli_argument('storage account create', 'tags', tags_type)
register_cli_argument('storage account create', 'https_only', help='Allows https traffic only to storage service.', **three_state_flag())

for item in ['create', 'update']:
    register_cli_argument('storage account {}'.format(item), 'sku', help='The storage account SKU.', **model_choice_list(ResourceType.MGMT_STORAGE, 'SkuName'))
    es_model = get_sdk(ResourceType.MGMT_STORAGE, 'models#EncryptionServices')
    if es_model:
        register_cli_argument('storage account {}'.format(item), 'encryption', nargs='+', help='Specifies which service(s) to encrypt.', validator=validate_encryption, **enum_choice_list(list(es_model._attribute_map.keys())))  # pylint: disable=protected-access

register_cli_argument('storage account create', 'access_tier', help='Required for StandardBlob accounts. The access tier used for billing. Cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types.', **model_choice_list(ResourceType.MGMT_STORAGE, 'AccessTier'))
register_cli_argument('storage account update', 'access_tier', help='The access tier used for billing StandardBlob accounts. Cannot be set for StandardLRS, StandardGRS, StandardRAGRS, or PremiumLRS account types.', **model_choice_list(ResourceType.MGMT_STORAGE, 'AccessTier'))
register_cli_argument('storage account create', 'custom_domain', help='User domain assigned to the storage account. Name is the CNAME source.')
register_cli_argument('storage account update', 'custom_domain', help='User domain assigned to the storage account. Name is the CNAME source. Use "" to clear existing value.', validator=validate_custom_domain)
register_cli_argument('storage account update', 'use_subdomain', help='Specify whether to use indirect CNAME validation.', **enum_choice_list(['true', 'false']))

register_cli_argument('storage account update', 'tags', tags_type, default=None)
register_cli_argument('storage account update', 'https_only', help='Allows https traffic only to storage service.', **three_state_flag())
    register_extra_cli_argument(scope, 'expires', default=None, help='Expiration UTC datetime  (Y-m-d\'T\'H:M:S\'Z\').', type=datetime_type)
    register_extra_cli_argument(scope, 'not_before', default=None, help='Key not usable before the provided UTC datetime  (Y-m-d\'T\'H:M:S\'Z\').', type=datetime_type)

# ARGUMENT DEFINITIONS

vault_name_type = CliArgumentType(help='Name of the key vault.', options_list=('--vault-name',), metavar='NAME', completer=get_resource_name_completion_list('Microsoft.KeyVault/vaults'), id_part=None)

# PARAMETER REGISTRATIONS

register_cli_argument('keyvault', 'resource_group_name', resource_group_name_type, id_part=None, required=False, help='Proceed only if Key Vault belongs to the specified resource group.', validator=validate_resource_group_name)
register_cli_argument('keyvault', 'vault_name', vault_name_type, options_list=('--name', '-n'))
register_cli_argument('keyvault', 'object_id', help='a GUID that identifies the principal that will receive permissions')
register_cli_argument('keyvault', 'spn', help='name of a service principal that will receive permissions')
register_cli_argument('keyvault', 'upn', help='name of a user principal that will receive permissions')
register_cli_argument('keyvault', 'tags', tags_type)
register_cli_argument('keyvault', 'enabled_for_deployment', help='Allow Virtual Machines to retrieve certificates stored as secrets from the vault.', **three_state_flag())
register_cli_argument('keyvault', 'enabled_for_disk_encryption', help='Allow Disk Encryption to retrieve secrets from the vault and unwrap keys.', **three_state_flag())
register_cli_argument('keyvault', 'enabled_for_template_deployment', help='Allow Resource Manager to retrieve secrets from the vault.', **three_state_flag())

register_cli_argument('keyvault create', 'resource_group_name', resource_group_name_type, required=True, completer=None, validator=None)
register_cli_argument('keyvault create', 'vault_name', completer=None)
register_cli_argument('keyvault create', 'sku', **enum_choice_list(SkuName))
register_cli_argument('keyvault create', 'no_self_perms', help="Don't add permissions for the current user/service principal in the new vault", **three_state_flag())
register_cli_argument('keyvault create', 'location', validator=get_default_location_from_resource_group)

register_cli_argument('keyvault list', 'resource_group_name', resource_group_name_type, validator=None)

register_cli_argument('keyvault delete-policy', 'object_id', validator=validate_principal)
register_cli_argument('keyvault set-policy', 'key_permissions', metavar='PERM', nargs='*', help='Space separated list. Possible values: {}'.format(key_permission_values), arg_group='Permission', validator=validate_policy_permissions)
register_cli_argument('keyvault set-policy', 'secret_permissions', metavar='PERM', nargs='*', help='Space separated list. Possible values: {}'.format(secret_permission_values), arg_group='Permission')
register_cli_argument('keyvault set-policy', 'certificate_permissions', metavar='PERM', nargs='*', help='Space separated list. Possible values: {}'.format(certificate_permission_values), arg_group='Permission')
示例#13
0
register_cli_argument('backup recoverypoint list', 'end_date', type=datetime_type, help='The end date of the range in UTC (d-m-Y).')

register_cli_argument('backup recoverypoint show', 'name', rp_name_type, options_list=('--name', '-n'), help='Name of the recovery point. You can use the backup recovery point list command to get the name of a backed up item.')

# Protection
register_cli_argument('backup protection', 'vault_name', vault_name_type)
register_cli_argument('backup protection enable-for-vm', 'vm', help='Name or ID of the Virtual Machine to be protected.')
register_cli_argument('backup protection enable-for-vm', 'policy_name', policy_name_type)

for command in ['backup-now', 'disable']:
    register_cli_argument('backup protection {}'.format(command), 'container_name', container_name_type)
    register_cli_argument('backup protection {}'.format(command), 'item_name', item_name_type)

register_cli_argument('backup protection backup-now', 'retain_until', type=datetime_type, help='The date until which this backed up copy will be available for retrieval, in UTC (d-m-Y).')

register_cli_argument('backup protection disable', 'delete_backup_data', help='Option to delete existing backed up data in the Recovery services vault.', **three_state_flag())

# Restore
for command in ['restore-disks', 'files']:
    register_cli_argument('backup restore {}'.format(command), 'vault_name', vault_name_type)
    register_cli_argument('backup restore {}'.format(command), 'container_name', container_name_type)
    register_cli_argument('backup restore {}'.format(command), 'item_name', item_name_type)
    register_cli_argument('backup restore {}'.format(command), 'rp_name', rp_name_type)

register_cli_argument('backup restore restore-disks', 'storage_account', help='Name or ID of the storge account to which disks are restored.')

# Job
register_cli_argument('backup job', 'vault_name', vault_name_type)

for command in ['show', 'stop', 'wait']:
    register_cli_argument('backup job {}'.format(command), 'name', job_name_type, help='Name of the job. You can use the backup job list command to get the name of a job.')
示例#14
0
                      'rule_name',
                      name_arg_type,
                      id_part='name',
                      help='Name of the alert rule.')

register_cli_argument('monitor alert create',
                      'rule_name',
                      name_arg_type,
                      id_part='name',
                      help='Name of the alert rule.')

register_cli_argument('monitor alert create',
                      'custom_emails',
                      nargs='+',
                      arg_group='Action')
register_cli_argument('monitor alert create', 'disabled', **three_state_flag())
register_cli_argument('monitor alert create',
                      'email_service_owners',
                      arg_group='Action',
                      **three_state_flag())
register_cli_argument('monitor alert create',
                      'actions',
                      options_list=['--action', '-a'],
                      action=AlertAddAction,
                      nargs='+',
                      arg_group='Action')
register_cli_argument('monitor alert create',
                      'condition',
                      action=ConditionAction,
                      nargs='+')
register_cli_argument('monitor alert create',