Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amlim/update control plane2023 04 01 #75

Merged
merged 2 commits into from
Apr 26, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

@register_command_group(
"devcenter",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage resources with devcenter
"""Manage resources with devcenter.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

@register_command_group(
"devcenter admin",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage admin resources.
"""Manage devcenter admin resources.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command_group(
"devcenter admin attached-network",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage attached networks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

@register_command(
"devcenter admin attached-network create",
is_preview=True,
)
class Create(AAZCommand):
"""Create an attached network connection.

:example: Create
az devcenter admin attached-network create --attached-network-connection-name "{attachedNetworkConnectionName}" --network-connection-id "/subscriptions/{subscriptionId}/resourceGroups/rg1/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin attached-network create --attached-network-connection-name "network-uswest3" --network-connection-id "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/NetworkConnections/network-uswest3" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@

@register_command(
"devcenter admin attached-network delete",
is_preview=True,
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete an attached network connection.

:example: Delete
az devcenter admin attached-network delete --attached-network-connection-name "{attachedNetworkConnectionName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin attached-network delete --attached-network-connection-name "network-uswest3" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@

@register_command(
"devcenter admin attached-network list",
is_preview=True,
)
class List(AAZCommand):
"""List the attached network connections configured for a dev center or a project.
"""List the attached network connections for a dev center or project.

:example: List by dev center
az devcenter admin attached-network list --dev-center-name "Contoso" --resource-group "rg1"

:example: List by project
az devcenter admin attached-network list --project-name "{projectName}" --resource-group "rg1"
az devcenter admin attached-network list --project-name "DevProject" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command_group(
"devcenter admin catalog",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage catalogs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@

@register_command(
"devcenter admin catalog create",
is_preview=True,
)
class Create(AAZCommand):
"""Create a catalog.

:example: Create using an Azure DevOps repository
az devcenter admin catalog create --ado-git path="/templates" branch="main" secret-identifier="https://contosokv.vault.azure.net/secrets/CentralRepoPat" uri="https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso" --name "{catalogName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin catalog create --ado-git path="/templates" branch="main" secret-identifier="https://contosokv.vault.azure.net/secrets/CentralRepoPat" uri="https://contoso@dev.azure.com/contoso/contosoOrg/_git/centralrepo-fakecontoso" --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1"

:example: Create using a GitHub repository
az devcenter admin catalog create --git-hub path="/templates" branch="main" secret-identifier="https://contosokv.vault.azure.net/secrets/CentralRepoPat" uri="https://github.com/Contoso/centralrepo-fake.git" --name "{catalogName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin catalog create --git-hub path="/templates" branch="main" secret-identifier="https://contosokv.vault.azure.net/secrets/CentralRepoPat" uri="https://github.com/Contoso/centralrepo-fake.git" --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@

@register_command(
"devcenter admin catalog delete",
is_preview=True,
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete a catalog.
"""Delete a catalog resource.

:example: Delete
az devcenter admin catalog delete --name "{catalogName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin catalog delete --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"devcenter admin catalog list",
is_preview=True,
)
class List(AAZCommand):
"""List catalogs for a dev center.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

@register_command(
"devcenter admin catalog show",
is_preview=True,
)
class Show(AAZCommand):
"""Get a catalog.

:example: Show
az devcenter admin catalog show --name "{catalogName}" --dev-center-name "Contoso" --resource-group "rg1"
:example: Get
az devcenter admin catalog show --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

@register_command(
"devcenter admin catalog sync",
is_preview=True,
)
class Sync(AAZCommand):
"""Syncs templates for a template source.

:example: Sync
az devcenter admin catalog sync --name "{catalogName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin catalog sync --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down Expand Up @@ -48,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema = cls._args_schema
_args_schema.catalog_name = AAZStrArg(
options=["-n", "--name", "--catalog-name"],
help="The name of the Catalog.",
help="The name of the catalog.",
required=True,
id_part="child_name_1",
)
Expand Down Expand Up @@ -87,20 +86,12 @@ def __call__(self, *args, **kwargs):
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200,
None,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
path_format_arguments=self.url_parameters,
)

return self.on_error(session.http_response)

@property
Expand Down Expand Up @@ -150,8 +141,6 @@ def query_parameters(self):
}
return parameters

def on_200(self, session):
pass

class _SyncHelper:
"""Helper class for Sync"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

@register_command(
"devcenter admin catalog update",
is_preview=True,
)
class Update(AAZCommand):
"""Update a catalog.

:example: Update
az devcenter admin catalog update --git-hub path="/environments" --name "{catalogName}" --dev-center-name "Contoso" --resource-group "rg1"
az devcenter admin catalog update --git-hub path="/environments" --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1"
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

@register_command_group(
"devcenter admin check-name-availability",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage check name availability with devcenter
"""Manage check name availability.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"devcenter admin check-name-availability execute",
is_preview=True,
)
class Execute(AAZCommand):
"""Check the availability of name for resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command_group(
"devcenter admin devbox-definition",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage dev box definitions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

@register_command(
"devcenter admin devbox-definition create",
is_preview=True,
)
class Create(AAZCommand):
"""Create a dev box definition.
Expand Down Expand Up @@ -48,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema = cls._args_schema
_args_schema.dev_box_definition_name = AAZStrArg(
options=["-n", "--name", "--dev-box-definition-name"],
help="The name of the Dev Box definition.",
help="The name of the dev box definition.",
required=True,
)
_args_schema.dev_center_name = AAZStrArg(
Expand Down Expand Up @@ -87,7 +86,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.hibernate_support = AAZStrArg(
options=["--hibernate-support"],
arg_group="Properties",
help="Indicates whether Dev Boxes created with this definition are capable of hibernation. Not all images are capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate",
help="Indicates whether dev boxes created with this definition are capable of hibernation. Not all images are capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate",
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
)
_args_schema.image_reference = AAZObjectArg(
Expand All @@ -98,12 +97,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.os_storage_type = AAZStrArg(
options=["--os-storage-type"],
arg_group="Properties",
help="The storage type used for the Operating System disk of Dev Boxes created using this definition.",
help="The storage type used for the operating system disk of dev boxes created using this definition.",
)
_args_schema.sku = AAZObjectArg(
options=["--sku"],
arg_group="Properties",
help="The SKU for Dev Boxes created using this definition.",
help="The SKU for dev boxes created using this definition.",
)

image_reference = cls._args_schema.image_reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@

@register_command(
"devcenter admin devbox-definition delete",
is_preview=True,
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete a Dev Box definition
"""Delete a dev box definition.

:example: Delete
az devcenter admin devbox-definition delete --name "WebDevBox" --dev-center-name "Contoso" --resource-group "rg1"
Expand Down Expand Up @@ -49,7 +48,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema = cls._args_schema
_args_schema.dev_box_definition_name = AAZStrArg(
options=["-n", "--name", "--dev-box-definition-name"],
help="The name of the Dev Box definition.",
help="The name of the dev box definition.",
required=True,
id_part="child_name_1",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

@register_command(
"devcenter admin devbox-definition list",
is_preview=True,
)
class List(AAZCommand):
"""List Dev Box definitions configured for a project.
"""List dev box definitions configured for a dev center or project.

:example: List by dev center
az devcenter admin devbox-definition list --dev-center-name "Contoso" --resource-group "rg1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

@register_command(
"devcenter admin devbox-definition update",
is_preview=True,
)
class Update(AAZCommand):
"""Update a Dev Box definition.
"""Update a dev box definition.

:example: Update
az devcenter admin devbox-definition update --image-reference id="/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/version/2.0.0" --name "WebDevBox" --dev-center-name "Contoso" --resource-group "rg1"
Expand Down Expand Up @@ -50,7 +49,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema = cls._args_schema
_args_schema.dev_box_definition_name = AAZStrArg(
options=["-n", "--name", "--dev-box-definition-name"],
help="The name of the Dev Box definition.",
help="The name of the dev box definition.",
required=True,
id_part="child_name_1",
)
Expand Down Expand Up @@ -86,7 +85,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.hibernate_support = AAZStrArg(
options=["--hibernate-support"],
arg_group="Properties",
help="Indicates whether Dev Boxes created with this definition are capable of hibernation. Not all images are capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate",
help="Indicates whether dev boxes created with this definition are capable of hibernation. Not all images are capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate",
nullable=True,
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
)
Expand All @@ -98,13 +97,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.os_storage_type = AAZStrArg(
options=["--os-storage-type"],
arg_group="Properties",
help="The storage type used for the Operating System disk of Dev Boxes created using this definition.",
help="The storage type used for the operating system disk of dev boxes created using this definition.",
nullable=True,
)
_args_schema.sku = AAZObjectArg(
options=["--sku"],
arg_group="Properties",
help="The SKU for Dev Boxes created using this definition.",
help="The SKU for dev boxes created using this definition.",
)

image_reference = cls._args_schema.image_reference
Expand Down
Loading