Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/blueprint/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.3.1
+++++
* Migrate blueprint to track2 SDK

0.3.0
+++++
* Allow user to export blueprint and artifacts to local directory
Expand Down
4 changes: 2 additions & 2 deletions src/blueprint/azext_blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def __init__(self, cli_ctx=None):
blueprint_custom = CliCommandType(
operations_tmpl='azext_blueprint.custom#{}',
client_factory=cf_blueprint)
super(BlueprintCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=blueprint_custom)
super().__init__(cli_ctx=cli_ctx,
custom_command_type=blueprint_custom)

def load_command_table(self, args):
from azext_blueprint.commands import load_command_table
Expand Down
159 changes: 118 additions & 41 deletions src/blueprint/azext_blueprint/_params.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/blueprint/azext_blueprint/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def blueprint_validator(cmd, namespace):
namespace.scope = '/providers/Microsoft.Management/managementGroups/{}'.format(
namespace.resource_scope = '/providers/Microsoft.Management/managementGroups/{}'.format(
namespace.management_group
) if namespace.management_group else '/subscriptions/{}'.format(
namespace.subscription if namespace.subscription else get_subscription_id(cmd.cli_ctx))
Expand All @@ -19,7 +19,7 @@ def blueprint_assignment_validator(cmd, namespace):
from knack.util import CLIError
if namespace.management_group:
raise CLIError("The management group scope for blueprint assignment is not supported yet. Please use --subscription for subscription scope.")
namespace.scope = '/subscriptions/{}'.format(namespace.subscription if namespace.subscription else get_subscription_id(cmd.cli_ctx))
namespace.resource_scope = '/subscriptions/{}'.format(namespace.subscription if namespace.subscription else get_subscription_id(cmd.cli_ctx))
try:
if namespace.user_assigned_identity and not namespace.identity_type:
namespace.identity_type = 'UserAssigned'
Expand Down
5 changes: 3 additions & 2 deletions src/blueprint/azext_blueprint/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ def __call__(self, parser, namespace, values, option_string=None):
key, value = item.split('=', 1)
rg[key] = value
except ValueError:
raise CLIError('Usage error: {} artifact_name=VALUE name=VALUE location=VALUE'.format(option_string))
raise CLIError('Usage error: {} artifact_name=VALUE name=VALUE location=VALUE'
.format(option_string)) from ValueError
if 'artifact_name' not in rg:
raise CLIError('{} must provide value for artifact_name in the format of artifact_name=VALUE'
.format(option_string))
super(ResourceGroupAssignAddAction, self).__call__(parser, namespace, rg, option_string)
super().__call__(parser, namespace, rg, option_string)
27 changes: 18 additions & 9 deletions src/blueprint/azext_blueprint/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def load_command_table(self, _):

from ._client_factory import cf_blueprints
blueprint_blueprints = CliCommandType(
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._blueprints_operations#BlueprintsOperations.{}',
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._blueprints_operations#BlueprintsOperations'
'.{}',
client_factory=cf_blueprints)
with self.command_group('blueprint', blueprint_blueprints, client_factory=cf_blueprints, is_experimental=True) as g:
g.custom_command('create', 'create_blueprint')
Expand All @@ -25,7 +26,9 @@ def load_command_table(self, _):
g.custom_command('delete', 'delete_blueprint', confirmation=True)
g.custom_show_command('show', 'get_blueprint')
g.custom_command('list', 'list_blueprint')
g.custom_command('import', 'import_blueprint_with_artifacts', confirmation="This operation will overwrite any unpublished changes if the blueprint already exists.")
g.custom_command('import', 'import_blueprint_with_artifacts',
confirmation="This operation will overwrite any unpublished changes"
" if the blueprint already exists.")
g.custom_command('export', 'export_blueprint_with_artifacts')

with self.command_group('blueprint resource-group', blueprint_blueprints, client_factory=cf_blueprints) as g:
Expand All @@ -37,7 +40,8 @@ def load_command_table(self, _):

from ._client_factory import cf_artifacts
blueprint_artifacts = CliCommandType(
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._artifacts_operations#ArtifactsOperations.{}',
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._artifacts_operations#ArtifactsOperations'
'.{}',
client_factory=cf_artifacts)
with self.command_group('blueprint artifact', blueprint_artifacts, client_factory=cf_artifacts) as g:
g.custom_command('delete', 'delete_blueprint_artifact', confirmation=True)
Expand All @@ -58,31 +62,36 @@ def load_command_table(self, _):

from ._client_factory import cf_published_blueprints
blueprint_published_blueprints = CliCommandType(
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._published_blueprints_operations#PublishedBlueprintsOperations.{}',
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:
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.{}',
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:
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')

from ._client_factory import cf_assignments
blueprint_assignments = CliCommandType(
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations._assignments_operations#AssignmentsOperations.{}',
operations_tmpl='azext_blueprint.vendored_sdks.blueprint.operations'
'._assignments_operations#AssignmentsOperations.{}',
client_factory=cf_assignments)
with self.command_group('blueprint assignment', blueprint_assignments, client_factory=cf_assignments) as g:
g.custom_command('create', 'create_blueprint_assignment')
g.custom_command('update', 'update_blueprint_assignment')
g.custom_command('delete', 'delete_blueprint_assignment', confirmation=True)
g.custom_show_command('show', 'get_blueprint_assignment')
g.custom_command('list', 'list_blueprint_assignment')
g.wait_command('wait')
g.custom_wait_command('wait', 'get_blueprint_assignment')
g.custom_command('who', 'who_is_blueprint_blueprint_assignment')
Loading