How to use the azure.cli.core.commands.CliCommandType function in azure

To help you get started, we’ve selected a few azure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-cli / src / azure-cli / azure / cli / command_modules / monitor / commands.py View on Github external
cf_metric_alerts, cf_log_analytics_workspace)
    from ._exception_handler import monitor_exception_handler, missing_resource_handler
    from .transformers import (action_group_list_table)
    from .validators import process_autoscale_create_namespace

    monitor_custom = CliCommandType(
        operations_tmpl='azure.cli.command_modules.monitor.custom#{}',
        exception_handler=monitor_exception_handler)

    action_group_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.monitor.operations#ActionGroupsOperations.{}',
        client_factory=cf_action_groups,
        operation_group='action_groups',
        exception_handler=monitor_exception_handler)

    action_group_custom = CliCommandType(
        operations_tmpl='azure.cli.command_modules.monitor.operations.action_groups#{}',
        client_factory=cf_action_groups,
        operation_group='action_groups',
        exception_handler=monitor_exception_handler)

    activity_log_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.monitor.operations#EventCategoriesOperations.{}',
        client_factory=cf_event_categories,
        operation_group='event_categories',
        exception_handler=monitor_exception_handler)

    activity_log_alerts_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.monitor.operations#ActivityLogAlertsOperations.{}',
        client_factory=cf_activity_log_alerts,
        operation_group='activity_log_alerts',
        exception_handler=monitor_exception_handler)
github Azure / azure-cli / src / azure-cli / azure / cli / command_modules / vm / commands.py View on Github external
compute_vm_usage_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.compute.operations#UsageOperations.{}',
        client_factory=cf_usage
    )

    compute_vm_run_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.compute.operations#VirtualMachineRunCommandsOperations.{}',
        client_factory=cf_run_commands
    )

    compute_vm_size_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.compute.operations#VirtualMachineSizesOperations.{}',
        client_factory=cf_vm_sizes
    )

    compute_vmss_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.compute.operations#VirtualMachineScaleSetsOperations.{}',
        client_factory=cf_vmss,
        operation_group='virtual_machine_scale_sets'
    )

    compute_vmss_rolling_upgrade_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.compute.operations#VirtualMachineScaleSetRollingUpgradesOperations.{}',
        client_factory=cf_rolling_upgrade_commands,
        operation_group='virtual_machine_scale_sets'
    )

    compute_vmss_vm_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.compute.operations#VirtualMachineScaleSetVMsOperations.{}',
        client_factory=cf_vmss_vm,
        operation_group='virtual_machine_scale_sets'
    )
github Azure / azure-cli-extensions / src / peering / azext_peering / generated / commands.py View on Github external
g.custom_show_command('show', 'peering_peering_show')
        g.custom_command('create', 'peering_peering_create')
        g.custom_command('update', 'peering_peering_update')
        g.custom_command('delete', 'peering_peering_delete')

    from azext_peering.generated._client_factory import cf_received_route
    peering_received_route = CliCommandType(
        operations_tmpl='azext_peering.vendored_sdks.peering.operations._received_route_operations#ReceivedRouteOperati'
        'ons.{}',
        client_factory=cf_received_route)
    with self.command_group('peering received-route', peering_received_route, client_factory=cf_received_route,
                            is_experimental=True) as g:
        g.custom_command('list', 'peering_received_route_list')

    from azext_peering.generated._client_factory import cf_peering_service_country
    peering_peering_service_country = CliCommandType(
        operations_tmpl='azext_peering.vendored_sdks.peering.operations._peering_service_country_operations#PeeringServ'
        'iceCountryOperations.{}',
        client_factory=cf_peering_service_country)
    with self.command_group('peering service country', peering_peering_service_country,
                            client_factory=cf_peering_service_country) as g:
        g.custom_command('list', 'peering_service_country_list')

    from azext_peering.generated._client_factory import cf_peering_service_location
    peering_peering_service_location = CliCommandType(
        operations_tmpl='azext_peering.vendored_sdks.peering.operations._peering_service_location_operations#PeeringSer'
        'viceLocationOperations.{}',
        client_factory=cf_peering_service_location)
    with self.command_group('peering service location', peering_peering_service_location,
                            client_factory=cf_peering_service_location) as g:
        g.custom_command('list', 'peering_service_location_list')
github Azure / azure-devops-cli-extension / azure-devops / azext_devops / dev / boards / commands.py View on Github external
from azext_devops.dev.common.exception_handler import azure_devops_exception_handler
from ._format import (transform_work_item_table_output,
                      transform_work_item_query_result_table_output,
                      transform_work_item_relation_type_table_output,
                      transform_work_item_relations,
                      transform_work_item_team_iterations_table_output,
                      transform_work_item_team_iteration_table_output,
                      transform_work_item_team_iteration_work_items,
                      transform_work_item_team_default_iteration_table_output,
                      transform_work_item_team_backlog_iteration_table_output,
                      transform_work_item_project_classification_nodes_table_output,
                      transform_work_item_project_classification_node_table_output,
                      transform_work_item_team_areas_table_output)


workItemOps = CliCommandType(
    operations_tmpl='azext_devops.dev.boards.work_item#{}',
    exception_handler=azure_devops_exception_handler
)

relationsOps = CliCommandType(
    operations_tmpl='azext_devops.dev.boards.relations#{}',
    exception_handler=azure_devops_exception_handler
)

workProjectAndTeamIterationOps = CliCommandType(
    operations_tmpl='azext_devops.dev.boards.iteration#{}',
    exception_handler=azure_devops_exception_handler
)

workProjectAndTeamAreaOps = CliCommandType(
    operations_tmpl='azext_devops.dev.boards.area#{}',
github Azure / azure-devops-cli-extension / azure-devops / azext_devops / dev / pipelines / commands.py View on Github external
releaseDefinitionOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.release_definition#{}',
    exception_handler=azure_devops_exception_handler
)

pipelinesOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.pipeline#{}',
    exception_handler=azure_devops_exception_handler
)

pipelineCreateOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.pipeline_create#{}',
    exception_handler=azure_devops_exception_handler
)

pipelinesRunOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.pipeline_run#{}',
    exception_handler=azure_devops_exception_handler
)

pipelineRunArtifactsOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.runs_artifacts#{}',
    exception_handler=azure_devops_exception_handler
)

pipelineAgentPoolQueueOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.agent_pool_queue#{}',
    exception_handler=azure_devops_exception_handler
)

pipelineVariableGroupOps = CliCommandType(
    operations_tmpl='azext_devops.dev.pipelines.variable_group#{}',
github Azure / azure-cli / src / azure-cli / azure / cli / command_modules / rdbms / commands.py View on Github external
mariadb_vnet_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.mariadb.operations#VirtualNetworkRulesOperations.{}',
        client_factory=cf_mariadb_virtual_network_rules_operations
    )

    mysql_vnet_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.mysql.operations#VirtualNetworkRulesOperations.{}',
        client_factory=cf_mysql_virtual_network_rules_operations
    )

    postgres_vnet_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.postgresql.operations#VirtualNetworkRulesOperations.{}',
        client_factory=cf_postgres_virtual_network_rules_operations
    )

    mariadb_config_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.mariadb.operations#ConfigurationsOperations.{}',
        client_factory=cf_mariadb_config
    )

    mysql_config_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.mysql.operations#ConfigurationsOperations.{}',
        client_factory=cf_mysql_config
    )

    postgres_config_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.postgresql.operations#ConfigurationsOperations.{}',
        client_factory=cf_postgres_config
    )

    mariadb_log_sdk = CliCommandType(
        operations_tmpl='azure.mgmt.rdbms.mariadb.operations#LogFilesOperations.{}',
github Azure / azure-cli / src / azure-cli / azure / cli / command_modules / sqlvm / commands.py View on Github external
)

    with self.command_group('sql vm group',
                            sqlvm_group_operations,
                            client_factory=get_sqlvirtualmachine_sql_virtual_machine_groups_operations) as g:
        g.generic_update_command('update', custom_func_name='sqlvm_group_update', transform=transform_sqlvm_group_output)
        g.command('show', 'get', transform=transform_sqlvm_group_output)
        g.custom_command('list', 'sqlvm_group_list', transform=transform_sqlvm_group_list)
        g.command('delete', 'delete', confirmation=True)
        g.custom_command('create', 'sqlvm_group_create', transform=transform_sqlvm_group_output, table_transformer=deployment_validate_table_format, exception_handler=handle_template_based_exception)

    ###############################################
    #      availability group listener            #
    ###############################################

    sqlvm_agl_operations = CliCommandType(
        operations_tmpl='azure.mgmt.sqlvirtualmachine.operations#AvailabilityGroupListenersOperations.{}',
        client_factory=get_sqlvirtualmachine_availability_group_listeners_operations
    )

    with self.command_group('sql vm group ag-listener',
                            sqlvm_agl_operations,
                            client_factory=get_sqlvirtualmachine_availability_group_listeners_operations) as g:
        g.generic_update_command('update', custom_func_name='aglistener_update', transform=transform_aglistener_output)
        g.command('show', 'get', transform=transform_aglistener_output)
        g.command('list', 'list_by_group', transform=transform_aglistener_list)
        g.command('delete', 'delete', confirmation=True)
        g.custom_command('create', 'sqlvm_aglistener_create', transform=transform_aglistener_output, table_transformer=deployment_validate_table_format, exception_handler=handle_template_based_exception)

    with self.command_group('sql vm', is_preview=True):
        pass
github Azure / azure-cli / src / azure-cli / azure / cli / command_modules / dls / commands.py View on Github external
)
    adls_format_path = 'azure.mgmt.datalake.store.operations.{}#{}.{{}}'

    dls_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.dls.custom#{}')

    dls_account_sdk = CliCommandType(
        operations_tmpl=adls_format_path.format('accounts_operations', 'AccountsOperations'),
        client_factory=cf_dls_account
    )

    dls_firewall_sdk = CliCommandType(
        operations_tmpl=adls_format_path.format('firewall_rules_operations', 'FirewallRulesOperations'),
        client_factory=cf_dls_account
    )

    dls_virtual_network_sdk = CliCommandType(
        operations_tmpl=adls_format_path.format('virtual_network_rules_operations', 'VirtualNetworkRulesOperations'),
        client_factory=cf_dls_account
    )

    dls_provider_sdk = CliCommandType(
        operations_tmpl=adls_format_path.format('trusted_id_providers_operations', 'TrustedIdProvidersOperations'),
        client_factory=cf_dls_account_trusted_provider
    )

    # account operations
    with self.command_group('dls account', dls_account_sdk, client_factory=cf_dls_account) as g:
        g.custom_command('create', 'create_adls_account')
        g.custom_command('update', 'update_adls_account')
        g.custom_command('list', 'list_adls_account')
        g.command('delete', 'delete')
        g.show_command('show', 'get')
github Azure / azure-cli / src / azure-cli / azure / cli / command_modules / servicebus / commands.py View on Github external
sb_topic_util = CliCommandType(
        operations_tmpl='azure.mgmt.servicebus.operations#TopicsOperations.{}',
        client_factory=topics_mgmt_client_factory
    )

    sb_subscriptions_util = CliCommandType(
        operations_tmpl='azure.mgmt.servicebus.operations#SubscriptionsOperations.{}',
        client_factory=subscriptions_mgmt_client_factory
    )

    sb_rule_util = CliCommandType(
        operations_tmpl='azure.mgmt.servicebus.operations#RulesOperations.{}',
        client_factory=rules_mgmt_client_factory
    )

    sb_geodr_util = CliCommandType(
        operations_tmpl='azure.mgmt.servicebus.operations#DisasterRecoveryConfigsOperations.{}',
        client_factory=disaster_recovery_mgmt_client_factory
    )

    sb_migration_util = CliCommandType(
        operations_tmpl='azure.mgmt.servicebus.operations#MigrationConfigsOperations.{}',
        client_factory=migration_mgmt_client_factory
    )

    from ._validators import validate_subnet

# Namespace Region
    custom_tmpl = 'azure.cli.command_modules.servicebus.custom#{}'
    servicebus_custom = CliCommandType(operations_tmpl=custom_tmpl)
    with self.command_group('servicebus namespace', sb_namespace_util, client_factory=namespaces_mgmt_client_factory) as g:
        g.custom_command('create', 'cli_namespace_create')
github Azure / azure-cli-extensions / src / blueprint / azext_blueprint / commands.py View on Github external
g.custom_command('list', 'list_blueprint_artifact')

    with self.command_group('blueprint artifact policy', blueprint_artifacts, client_factory=cf_artifacts) as g:
        g.custom_command('create', 'create_blueprint_artifact_policy')
        g.custom_command('update', 'update_blueprint_artifact_policy')

    with self.command_group('blueprint artifact role', blueprint_artifacts, client_factory=cf_artifacts) as g:
        g.custom_command('create', 'create_blueprint_artifact_role')
        g.custom_command('update', 'update_blueprint_artifact_role')

    with self.command_group('blueprint artifact template', blueprint_artifacts, client_factory=cf_artifacts) as g:
        g.custom_command('create', 'create_blueprint_artifact_template')
        g.custom_command('update', 'update_blueprint_artifact_template')

    from ._client_factory import cf_published_blueprints
    blueprint_published_blueprints = CliCommandType(
        operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._published_blueprints_operations#PublishedBlueprintsOperations.{}',
        client_factory=cf_published_blueprints)
    with self.command_group('blueprint', blueprint_published_blueprints, client_factory=cf_published_blueprints, is_experimental=True) as g:
        g.custom_command('publish', 'publish_blueprint')
        g.custom_command('version delete', 'delete_blueprint_version', confirmation=True)
        g.custom_command('version show', 'get_blueprint_version')
        g.custom_command('version list', 'list_blueprint_version')

    from ._client_factory import cf_published_artifacts
    blueprint_published_artifacts = CliCommandType(
        operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._published_artifacts_operations#PublishedArtifactsOperations.{}',
        client_factory=cf_published_artifacts)
    with self.command_group('blueprint version artifact', blueprint_published_artifacts, client_factory=cf_published_artifacts) as g:
        g.custom_show_command('show', 'get_blueprint_version_artifact')
        g.custom_command('list', 'list_blueprint_version_artifact')