From 8ec1549819e3a56c4f4a81ee959ad4ffef996ba2 Mon Sep 17 00:00:00 2001 From: Amanda Lim Date: Thu, 14 Sep 2023 15:32:43 -0700 Subject: [PATCH] Update to version 3.0.0 --- src/devcenter/HISTORY.rst | 5 + src/devcenter/azext_devcenter/_help.py | 34 -- src/devcenter/azext_devcenter/_params.py | 57 ---- .../devcenter/admin/catalog/__init__.py | 1 - .../devcenter/admin/catalog/_connect.py | 148 --------- .../catalog_devbox_definition/__cmd_group.py | 23 -- .../catalog_devbox_definition/__init__.py | 13 - .../admin/catalog_devbox_definition/_list.py | 307 ------------------ .../admin/catalog_devbox_definition/_show.py | 305 ----------------- src/devcenter/azext_devcenter/commands.py | 6 - .../tests/latest/test_devcenter_scenario.py | 101 +----- src/devcenter/setup.py | 2 +- 12 files changed, 7 insertions(+), 995 deletions(-) delete mode 100644 src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/_connect.py delete mode 100644 src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__cmd_group.py delete mode 100644 src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__init__.py delete mode 100644 src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_list.py delete mode 100644 src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_show.py diff --git a/src/devcenter/HISTORY.rst b/src/devcenter/HISTORY.rst index 15df0a78c67..e324dd2bbf4 100644 --- a/src/devcenter/HISTORY.rst +++ b/src/devcenter/HISTORY.rst @@ -2,6 +2,11 @@ Release History =============== +3.0.0 +++++++ +* Update control plane API to v2023-06-01-preview +* Update data plane API to v2023-07-01-preview + 2.0.0 ++++++ * Update dev-box-definition to devbox-definition parameter diff --git a/src/devcenter/azext_devcenter/_help.py b/src/devcenter/azext_devcenter/_help.py index 387565ec1e6..f8526287b93 100644 --- a/src/devcenter/azext_devcenter/_help.py +++ b/src/devcenter/azext_devcenter/_help.py @@ -650,37 +650,3 @@ az devcenter dev environment-definition show --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ --project-name "DevProject" --catalog-name "myCatalog" --definition-name "foo" """ - -# helps[ -# "devcenter dev environment list-operation" -# ] = """ -# type: command -# short-summary: "Lists operations on the environment which have occurred within the past 90 days." -# examples: -# - name: List operations using dev center -# text: |- -# az devcenter dev environment list-operation --dev-center-name "ContosoDevCenter" \ -# --project-name "DevProject" --name "myEnv" --user-id "00000000-0000-0000-0000-000000000000" -# - name: List operations using endpoint -# text: |- -# az devcenter dev environment list-operation --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ -# --project-name "DevProject" --name "myEnv" --user-id "00000000-0000-0000-0000-000000000000" -# """ - -# helps[ -# "devcenter dev environment show-operation" -# ] = """ -# type: command -# short-summary: "Gets an environment action result." -# examples: -# - name: Get operation using dev center -# text: |- -# az devcenter dev environment show-operation --dev-center-name "ContosoDevCenter" \ -# --project-name "DevProject" --name "myEnv" --operation-id \ -# "f5dbdfab-fa0e-4831-8d13-25359aa5e680" --user-id "00000000-0000-0000-0000-000000000000" -# - name: Get operation using endpoint -# text: |- -# az devcenter dev environment show-operation --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \ -# --project-name "DevProject" --name "myEnv" --operation-id \ -# "f5dbdfab-fa0e-4831-8d13-25359aa5e680" --user-id "00000000-0000-0000-0000-000000000000" -# """ diff --git a/src/devcenter/azext_devcenter/_params.py b/src/devcenter/azext_devcenter/_params.py index eadfc458434..669e36e7b6b 100644 --- a/src/devcenter/azext_devcenter/_params.py +++ b/src/devcenter/azext_devcenter/_params.py @@ -855,60 +855,3 @@ def load_arguments(self, _): "endpoint", arg_type=endpoint, ) - - # with self.argument_context("devcenter dev environment list-operation") as c: - # c.argument( - # "dev_center", - # arg_type=dev_center_type, - # ) - # c.argument( - # "project_name", - # arg_type=project_type, - # ) - # c.argument( - # "endpoint", - # arg_type=endpoint, - # ) - # c.argument( - # "user_id", - # type=str, - # help="The AAD object id of the user. If value is 'me', the identity is taken from the " - # "authentication context", - # ) - # c.argument( - # "environment_name", - # options_list=["--name", "-n", "--environment-name"], - # type=str, - # help="The name " "of the environment.", - # ) - - # with self.argument_context("devcenter dev environment show-operation") as c: - # c.argument( - # "dev_center", - # arg_type=dev_center_type, - # ) - # c.argument( - # "project_name", - # arg_type=project_type, - # ) - # c.argument( - # "endpoint", - # arg_type=endpoint, - # ) - # c.argument( - # "user_id", - # type=str, - # help="The AAD object id of the user. If value is 'me', the identity is taken from the " - # "authentication context", - # ) - # c.argument( - # "environment_name", - # options_list=["--name", "-n", "--environment-name"], - # type=str, - # help="The name " "of the environment.", - # ) - # c.argument( - # "operation_id", - # type=str, - # help="The id of the operation on a dev box.", - # ) diff --git a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/__init__.py b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/__init__.py index a217408fa94..9c0e5a03e4b 100644 --- a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/__init__.py +++ b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/__init__.py @@ -9,7 +9,6 @@ # flake8: noqa from .__cmd_group import * -from ._connect import * from ._create import * from ._delete import * from ._list import * diff --git a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/_connect.py b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/_connect.py deleted file mode 100644 index d5dbea20b30..00000000000 --- a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog/_connect.py +++ /dev/null @@ -1,148 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -# @register_command( -# "devcenter admin catalog connect", -# ) -class Connect(AAZCommand): - """Connects a catalog to enable syncing. - - :example: Connect - az devcenter admin catalog connect --name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1" - """ - - _aaz_info = { - "version": "2023-06-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.devcenter/devcenters/{}/catalogs/{}/connect", "2023-06-01-preview"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.catalog_name = AAZStrArg( - options=["--catalog-name"], - help="The name of the catalog.", - required=True, - id_part="child_name_1", - ) - _args_schema.dev_center_name = AAZStrArg( - options=["-d", "--dev-center", "--dev-center-name"], - help="The name of the dev center.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.CatalogsConnect(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class CatalogsConnect(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - 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 - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/connect", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "catalogName", self.ctx.args.catalog_name, - required=True, - ), - **self.serialize_url_param( - "devCenterName", self.ctx.args.dev_center_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-06-01-preview", - required=True, - ), - } - return parameters - - -class _ConnectHelper: - """Helper class for Connect""" - - -__all__ = ["Connect"] diff --git a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__cmd_group.py b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__cmd_group.py deleted file mode 100644 index 10c0eabbbfb..00000000000 --- a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -# @register_command_group( -# "devcenter admin catalog-devbox-definition", -# ) -class __CMDGroup(AAZCommandGroup): - """Manage catalog dev box definitions. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__init__.py b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__init__.py deleted file mode 100644 index 2df85698253..00000000000 --- a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._list import * -from ._show import * diff --git a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_list.py b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_list.py deleted file mode 100644 index fd8c53d21e9..00000000000 --- a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_list.py +++ /dev/null @@ -1,307 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -# @register_command( -# "devcenter admin catalog-devbox-definition list", -# ) -class List(AAZCommand): - """List dev box definitions in the catalog. - - :example: List - az devcenter admin catalog-devbox-definition list --catalog-name "CentralCatalog" --dev-center-name "Contoso" --resource-group "rg1" - """ - - _aaz_info = { - "version": "2023-06-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.devcenter/devcenters/{}/catalogs/{}/devboxdefinitions", "2023-06-01-preview"], - ] - } - - AZ_SUPPORT_PAGINATION = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.catalog_name = AAZStrArg( - options=["--catalog-name"], - help="The name of the catalog.", - required=True, - ) - _args_schema.dev_center_name = AAZStrArg( - options=["-d", "--dev-center", "--dev-center-name"], - help="The name of the dev center.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.CatalogDevBoxDefinitionsListByCatalog(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class CatalogDevBoxDefinitionsListByCatalog(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/devboxdefinitions", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "catalogName", self.ctx.args.catalog_name, - required=True, - ), - **self.serialize_url_param( - "devCenterName", self.ctx.args.dev_center_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-06-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType( - flags={"read_only": True}, - ) - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"required": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.active_image_reference = AAZObjectType( - serialized_name="activeImageReference", - ) - _ListHelper._build_schema_image_reference_read(properties.active_image_reference) - properties.hibernate_support = AAZStrType( - serialized_name="hibernateSupport", - ) - properties.image_reference = AAZObjectType( - serialized_name="imageReference", - flags={"required": True}, - ) - _ListHelper._build_schema_image_reference_read(properties.image_reference) - properties.image_validation_error_details = AAZObjectType( - serialized_name="imageValidationErrorDetails", - ) - properties.image_validation_status = AAZStrType( - serialized_name="imageValidationStatus", - ) - properties.os_storage_type = AAZStrType( - serialized_name="osStorageType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.sku = AAZObjectType( - flags={"required": True}, - ) - properties.validation_error_details = AAZListType( - serialized_name="validationErrorDetails", - flags={"read_only": True}, - ) - properties.validation_status = AAZStrType( - serialized_name="validationStatus", - ) - - image_validation_error_details = cls._schema_on_200.value.Element.properties.image_validation_error_details - image_validation_error_details.code = AAZStrType() - image_validation_error_details.message = AAZStrType() - - sku = cls._schema_on_200.value.Element.properties.sku - sku.capacity = AAZIntType() - sku.family = AAZStrType() - sku.name = AAZStrType( - flags={"required": True}, - ) - sku.size = AAZStrType() - sku.tier = AAZStrType() - - validation_error_details = cls._schema_on_200.value.Element.properties.validation_error_details - validation_error_details.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.validation_error_details.Element - _element.code = AAZStrType() - _element.message = AAZStrType() - - system_data = cls._schema_on_200.value.Element.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_image_reference_read = None - - @classmethod - def _build_schema_image_reference_read(cls, _schema): - if cls._schema_image_reference_read is not None: - _schema.exact_version = cls._schema_image_reference_read.exact_version - _schema.id = cls._schema_image_reference_read.id - return - - cls._schema_image_reference_read = _schema_image_reference_read = AAZObjectType() - - image_reference_read = _schema_image_reference_read - image_reference_read.exact_version = AAZStrType( - serialized_name="exactVersion", - flags={"read_only": True}, - ) - image_reference_read.id = AAZStrType() - - _schema.exact_version = cls._schema_image_reference_read.exact_version - _schema.id = cls._schema_image_reference_read.id - - -__all__ = ["List"] diff --git a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_show.py b/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_show.py deleted file mode 100644 index bc8a46f1a04..00000000000 --- a/src/devcenter/azext_devcenter/aaz/latest/devcenter/admin/catalog_devbox_definition/_show.py +++ /dev/null @@ -1,305 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -# @register_command( -# "devcenter admin catalog-devbox-definition show", -# ) -class Show(AAZCommand): - """Get a dev box definition from the catalog - - :example: Get - az devcenter admin catalog-devbox-definition show --catalog-name "CentralCatalog" -devbox-definition-name "devBoxDef" --dev-center-name "Contoso" --resource-group "rg1" - """ - - _aaz_info = { - "version": "2023-06-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.devcenter/devcenters/{}/catalogs/{}/devboxdefinitions/{}", "2023-06-01-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.catalog_name = AAZStrArg( - options=["--catalog-name"], - help="The name of the catalog.", - required=True, - id_part="child_name_1", - ) - _args_schema.devbox_definition_name = AAZStrArg( - options=["-n", "--name", "--devbox-definition-name"], - help="The name of the dev box definition.", - required=True, - id_part="child_name_2", - ) - _args_schema.dev_center_name = AAZStrArg( - options=["-d", "--dev-center", "--dev-center-name"], - help="The name of the dev center.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.CatalogDevBoxDefinitionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class CatalogDevBoxDefinitionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/devboxdefinitions/{devBoxDefinitionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "catalogName", self.ctx.args.catalog_name, - required=True, - ), - **self.serialize_url_param( - "devBoxDefinitionName", self.ctx.args.devbox_definition_name, - required=True, - ), - **self.serialize_url_param( - "devCenterName", self.ctx.args.dev_center_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2023-06-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.location = AAZStrType( - flags={"required": True}, - ) - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_image_reference = AAZObjectType( - serialized_name="activeImageReference", - ) - _ShowHelper._build_schema_image_reference_read(properties.active_image_reference) - properties.hibernate_support = AAZStrType( - serialized_name="hibernateSupport", - ) - properties.image_reference = AAZObjectType( - serialized_name="imageReference", - flags={"required": True}, - ) - _ShowHelper._build_schema_image_reference_read(properties.image_reference) - properties.image_validation_error_details = AAZObjectType( - serialized_name="imageValidationErrorDetails", - ) - properties.image_validation_status = AAZStrType( - serialized_name="imageValidationStatus", - ) - properties.os_storage_type = AAZStrType( - serialized_name="osStorageType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.sku = AAZObjectType( - flags={"required": True}, - ) - properties.validation_error_details = AAZListType( - serialized_name="validationErrorDetails", - flags={"read_only": True}, - ) - properties.validation_status = AAZStrType( - serialized_name="validationStatus", - ) - - image_validation_error_details = cls._schema_on_200.properties.image_validation_error_details - image_validation_error_details.code = AAZStrType() - image_validation_error_details.message = AAZStrType() - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.family = AAZStrType() - sku.name = AAZStrType( - flags={"required": True}, - ) - sku.size = AAZStrType() - sku.tier = AAZStrType() - - validation_error_details = cls._schema_on_200.properties.validation_error_details - validation_error_details.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.validation_error_details.Element - _element.code = AAZStrType() - _element.message = AAZStrType() - - system_data = cls._schema_on_200.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_image_reference_read = None - - @classmethod - def _build_schema_image_reference_read(cls, _schema): - if cls._schema_image_reference_read is not None: - _schema.exact_version = cls._schema_image_reference_read.exact_version - _schema.id = cls._schema_image_reference_read.id - return - - cls._schema_image_reference_read = _schema_image_reference_read = AAZObjectType() - - image_reference_read = _schema_image_reference_read - image_reference_read.exact_version = AAZStrType( - serialized_name="exactVersion", - flags={"read_only": True}, - ) - image_reference_read.id = AAZStrType() - - _schema.exact_version = cls._schema_image_reference_read.exact_version - _schema.id = cls._schema_image_reference_read.id - - -__all__ = ["Show"] diff --git a/src/devcenter/azext_devcenter/commands.py b/src/devcenter/azext_devcenter/commands.py index f49b2c91968..31a5640025c 100644 --- a/src/devcenter/azext_devcenter/commands.py +++ b/src/devcenter/azext_devcenter/commands.py @@ -157,10 +157,6 @@ def load_command_table(self, _): self.command_table["devcenter admin pool create"] = PoolCreate(loader=self) self.command_table["devcenter admin pool delete"] = PoolDelete(loader=self) self.command_table["devcenter admin pool list"] = PoolList(loader=self) - # TODO: Uncomment once feature is complete - # self.command_table["devcenter admin pool run-health-check"] = PoolRunHealthCheck( - # loader=self - # ) self.command_table["devcenter admin pool show"] = PoolShow(loader=self) self.command_table["devcenter admin pool update"] = PoolUpdate(loader=self) self.command_table["devcenter admin pool wait"] = PoolWait(loader=self) @@ -276,8 +272,6 @@ def load_command_table(self, _): supports_no_wait=True, confirmation=True, ) - # g.custom_command("list-operation", "devcenter_environment_operation_list") - # g.custom_command("show-operation", "devcenter_environment_operation_show") with self.command_group("devcenter dev catalog", environments_dp) as g: g.custom_command("list", "devcenter_catalog_list_dp") diff --git a/src/devcenter/azext_devcenter/tests/latest/test_devcenter_scenario.py b/src/devcenter/azext_devcenter/tests/latest/test_devcenter_scenario.py index e6481d71df8..7fb271b4f16 100644 --- a/src/devcenter/azext_devcenter/tests/latest/test_devcenter_scenario.py +++ b/src/devcenter/azext_devcenter/tests/latest/test_devcenter_scenario.py @@ -69,7 +69,6 @@ def test_dev_center_scenario(self): ], ) - #TODO: add devcenter create with encryption self.cmd( "az devcenter admin devcenter create " '--location "{location}" ' @@ -576,7 +575,6 @@ def test_devbox_definition_scenario(self): ], ) - #TODO: add validation error details and validation status self.cmd( "az devcenter admin devbox-definition show " '--dev-center "{devcenterName}" ' @@ -907,8 +905,6 @@ def test_pool_scenario(self): ], ) - # TODO: Add health check and health check details in return type when API available - # TODO: Add stopOnDisconnect idle back when available self.cmd( "az devcenter admin pool create " '-d "{devBoxDefinitionName}" ' @@ -968,14 +964,6 @@ def test_pool_scenario(self): ], ) - # TODO: Uncomment once feature is complete - # self.cmd( - # "az devcenter admin pool run-health-check " - # '--name "{poolName}" ' - # '--project-name "{projectName}" ' - # '--resource-group "{rg}" ' - # ) - self.cmd( "az devcenter admin schedule create " '--pool-name "{poolName}" ' @@ -1146,16 +1134,6 @@ def test_catalog_scenario(self): '--resource-group "{rg}" ' ) - #TODO: uncomment this when API works - # self.cmd( - # "az devcenter admin catalog connect " - # '--dev-center "{devcenterName}" ' - # '--name "{catalogName}" ' - # '--resource-group "{rg}" ' - # ) - - - #TODO: add connection state and last connection time self.cmd( "az devcenter admin catalog show " '--dev-center "{devcenterName}" ' @@ -1204,80 +1182,7 @@ def test_catalog_scenario(self): self.check("length(@)", 0), ], ) - - #TODO: complete when rolled out - # @ResourceGroupPreparer( - # name_prefix="clitestdevcenter_rg1"[:7], key="rg", parameter_name="rg" - # ) - # def test_catalog_devbox_def_scenario(self): - # self.kwargs.update( - # { - # "catalogName": self.create_random_name(prefix="c2", length=12), - # "branch": "main", - # "secretIdentifier": "https://dummy.fake.net/secrets/dummy/0000000000000000000000000000000", - # "uri": "https://domain.com/dummy/dummy.git", - # } - # ) - - # create_dev_center_with_identity(self) - - # imageRefId = f"{self.kwargs.get('devCenterId', '')}/galleries/Default/images/microsoftvisualstudio_visualstudioplustools_vs-2022-ent-general-win11-m365-gen2" - - # self.kwargs.update( - # { - # "imageRefId": imageRefId, - # } - # ) - - # create_kv_policy(self) - - # self.cmd( - # "az devcenter admin catalog create " - # '--dev-center "{devcenterName}" ' - # '--name "{catalogName}" ' - # '--git-hub path="{path}" branch="{branch}" ' - # 'secret-identifier="{secretIdentifier}" uri="{uri}" ' - # '--resource-group "{rg}" ', - # checks=[ - # self.check("name", "{catalogName}"), - # self.check("resourceGroup", "{rg}"), - # self.check("gitHub.branch", "{branch}"), - # self.check("gitHub.path", "{path}"), - # self.check("gitHub.secretIdentifier", "{secretIdentifier}"), - # self.check("gitHub.uri", "{uri}"), - # ], - # ) - - # self.cmd( - # "az devcenter admin catalog sync " - # '--dev-center "{devcenterName}" ' - # '--name "{catalogName}" ' - # '--resource-group "{rg}" ' - # ) - - # self.cmd( - # "az devcenter admin catalog-devbox-definition list " - # '--resource-group "{rg}" ' - # '--dev-center "{devcenterName}" ', - # checks=[ - # self.check("length(@)", 2), - # ], - # ) - - # self.cmd( - # "az devcenter admin catalog-devbox-definition show " - # '--dev-center "{devcenterName}" ' - # '--name "first" ' - # '--resource-group "{rg}" ', - # checks=[ - # self.check("name", "first"), - # self.check("activeImageReference.id", "{imageRefId}"), - # self.check("hibernateSupport", "Enabled"), - # self.check("imageReference.id", "{imageRefId}"), - # self.check("sku.name", "general_i_16c64gb512ssd_v2"), - # self.check("gitHub.uri", "{uri}"), - # ], - # ) + @ResourceGroupPreparer( name_prefix="clitestdevcenter_rg1"[:7], key="rg", parameter_name="rg" @@ -1609,8 +1514,6 @@ def test_pool_dataplane_scenario(self): ], ) - # TODO Add back idle parameters and checks once feature is complete - self.cmd( "az devcenter dev pool show " '--name "{poolName}" ' @@ -2060,7 +1963,6 @@ def test_dev_box_dataplane_scenario(self): '--dev-center "{devcenterName}" ' ).get_output_in_json() - # TODO: Recheck for idle once feature is complete self.kwargs.update( { "actionName": stopAction[0]["name"], @@ -2104,7 +2006,6 @@ def test_dev_box_dataplane_scenario(self): ], ) - #TODO: switch to just check for property self.cmd( "az devcenter dev dev-box delay-all-actions " '--name "{devBoxName}" ' diff --git a/src/devcenter/setup.py b/src/devcenter/setup.py index e41334fef50..acd0b04545e 100644 --- a/src/devcenter/setup.py +++ b/src/devcenter/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # HISTORY.rst entry. -VERSION = '2.0.0' +VERSION = '3.0.0' try: from azext_devcenter.manual.version import VERSION except ImportError: