From 1514657b6b5bd3e5f26cb4f78e11d7351050733a Mon Sep 17 00:00:00 2001 From: Chaoyi Yuan Date: Fri, 8 Mar 2024 16:04:58 +0800 Subject: [PATCH 1/6] feat: remove portal commands from apic-extension --- .../aaz/latest/__init__.py | 4 + .../aaz/latest/apic/service/_create.py | 4 - .../latest/apic/service/_import_from_apim.py | 6 +- .../aaz/latest/apic/service/_list.py | 8 - .../aaz/latest/apic/service/_show.py | 4 - .../aaz/latest/apic/service/_update.py | 4 - .../latest/apic/service/portal/__cmd_group.py | 23 - .../latest/apic/service/portal/__init__.py | 11 - .../service/portal/default/__cmd_group.py | 23 - .../apic/service/portal/default/__init__.py | 15 - .../apic/service/portal/default/_create.py | 329 ------------- .../apic/service/portal/default/_delete.py | 143 ------ .../apic/service/portal/default/_show.py | 239 --------- .../apic/service/portal/default/_update.py | 465 ------------------ .../azext_apic_extension/azext_metadata.json | 2 +- 15 files changed, 8 insertions(+), 1272 deletions(-) delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__cmd_group.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__init__.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__cmd_group.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__init__.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_create.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_delete.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_show.py delete mode 100644 src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_update.py diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/__init__.py b/src/apic-extension/azext_apic_extension/aaz/latest/__init__.py index 5757aea3175..f6acc11aa4e 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/__init__.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/__init__.py @@ -4,3 +4,7 @@ # # Code generated by aaz-dev-tools # -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py index 6214b70abc6..7382551b451 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py @@ -284,10 +284,6 @@ def _build_schema_on_200_201(cls): ) properties = cls._schema_on_200_201.properties - properties.data_api_hostname = AAZStrType( - serialized_name="dataApiHostname", - flags={"read_only": True}, - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py index f4454a6c98f..2e5b2936777 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py @@ -22,9 +22,9 @@ class ImportFromApim(AAZCommand): """ _aaz_info = { - "version": "2024-03-01", + "version": "2024-03-15-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/importfromapim", "2024-03-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/importfromapim", "2024-03-15-preview"], ] } @@ -148,7 +148,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-03-01", + "api-version", "2024-03-15-preview", required=True, ), } diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py index 178d5eef624..eabdc18a9da 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py @@ -214,10 +214,6 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.value.Element.properties - properties.data_api_hostname = AAZStrType( - serialized_name="dataApiHostname", - flags={"read_only": True}, - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -386,10 +382,6 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.value.Element.properties - properties.data_api_hostname = AAZStrType( - serialized_name="dataApiHostname", - flags={"read_only": True}, - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py index cc45ab554f0..3cb8512041b 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py @@ -211,10 +211,6 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.properties - properties.data_api_hostname = AAZStrType( - serialized_name="dataApiHostname", - flags={"read_only": True}, - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py index e4790148069..325353c3a0e 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py @@ -421,10 +421,6 @@ def _build_schema_service_read(cls, _schema): ) properties = _schema_service_read.properties - properties.data_api_hostname = AAZStrType( - serialized_name="dataApiHostname", - flags={"read_only": True}, - ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__cmd_group.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__cmd_group.py deleted file mode 100644 index aefec36e9a6..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__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( - "apic service portal", -) -class __CMDGroup(AAZCommandGroup): - """Commands to manage API Center Service Portal Configuration in API Center - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__init__.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__init__.py deleted file mode 100644 index 5a9d61963d6..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/__init__.py +++ /dev/null @@ -1,11 +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 * diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__cmd_group.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__cmd_group.py deleted file mode 100644 index 418e5b36703..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__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( - "apic service portal default", -) -class __CMDGroup(AAZCommandGroup): - """Default API Center Portal - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__init__.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__init__.py deleted file mode 100644 index a3db3e36481..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/__init__.py +++ /dev/null @@ -1,15 +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 ._create import * -from ._delete import * -from ._show import * -from ._update import * diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_create.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_create.py deleted file mode 100644 index 3d63c618207..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_create.py +++ /dev/null @@ -1,329 +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( - "apic service portal default create", -) -class Create(AAZCommand): - """Create new or updates existing portal configuration. - - :example: Create Default Portal Configuration - az apic service portal default create -g contoso-resources --service-name contoso --title "Contoso" --enabled false --authentication'{"clientId":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000"}' - """ - - _aaz_info = { - "version": "2024-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/portals/default", "2024-03-01"], - ] - } - - 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.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.service_name = AAZStrArg( - options=["-s", "--service", "--service-name"], - help="The name of Azure API Center service.", - required=True, - fmt=AAZStrArgFormat( - max_length=90, - min_length=1, - ), - ) - - # define Arg Group "Payload" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Payload", - help="The geo-location where the resource lives", - required=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Payload", - help="Resource tags.", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.authentication = AAZObjectArg( - options=["--authentication"], - arg_group="Properties", - help="Authentication configuration.", - ) - _args_schema.enabled = AAZBoolArg( - options=["--enabled"], - arg_group="Properties", - help="Flag indicating whether or not portal is enabled.", - ) - _args_schema.title = AAZStrArg( - options=["--title"], - arg_group="Properties", - help="Portal configuration Title.", - fmt=AAZStrArgFormat( - max_length=50, - ), - ) - - authentication = cls._args_schema.authentication - authentication.client_id = AAZStrArg( - options=["client-id"], - help="The Azure Active Directory application client id.", - required=True, - fmt=AAZStrArgFormat( - max_length=50, - min_length=1, - ), - ) - authentication.tenant_id = AAZStrArg( - options=["tenant-id"], - help="The Azure Active Directory application Tenant id.", - fmt=AAZStrArgFormat( - max_length=50, - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PortalConfigurationCreateOrUpdate(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 PortalConfigurationCreateOrUpdate(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.ApiCenter/services/{serviceName}/portals/default", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "serviceName", self.ctx.args.service_name, - 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", "2024-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("authentication", AAZObjectType, ".authentication", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enabled", AAZBoolType, ".enabled") - properties.set_prop("title", AAZStrType, ".title", typ_kwargs={"flags": {"required": True}}) - - authentication = _builder.get(".properties.authentication") - if authentication is not None: - authentication.set_prop("clientId", AAZStrType, ".client_id", typ_kwargs={"flags": {"required": True}}) - authentication.set_prop("tenantId", AAZStrType, ".tenant_id") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - 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.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.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authentication = AAZObjectType() - properties.created = AAZStrType() - properties.created_by = AAZStrType( - serialized_name="createdBy", - ) - properties.data_api_host_name = AAZStrType( - serialized_name="dataApiHostName", - ) - properties.enabled = AAZBoolType() - properties.portal_default_host_name = AAZStrType( - serialized_name="portalDefaultHostName", - ) - properties.title = AAZStrType() - properties.updated = AAZStrType() - properties.updated_by = AAZStrType( - serialized_name="updatedBy", - ) - - authentication = cls._schema_on_200.properties.authentication - authentication.azure_ad_instance = AAZStrType( - serialized_name="azureAdInstance", - flags={"read_only": True}, - ) - authentication.client_id = AAZStrType( - serialized_name="clientId", - flags={"required": True}, - ) - authentication.scopes = AAZStrType( - flags={"read_only": True}, - ) - authentication.tenant_id = AAZStrType( - serialized_name="tenantId", - ) - - 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", - ) - - return cls._schema_on_200 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_delete.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_delete.py deleted file mode 100644 index f3283064a35..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_delete.py +++ /dev/null @@ -1,143 +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( - "apic service portal default delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete specified PortalConfiguration. - - :example: Delete Default Portal Configuration - az apic service portal default delete -g contoso-resources --service-name contoso - """ - - _aaz_info = { - "version": "2024-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/portals/default", "2024-03-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return 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.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.service_name = AAZStrArg( - options=["-s", "--service", "--service-name"], - help="The name of Azure API Center service.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - max_length=90, - min_length=1, - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PortalConfigurationDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class PortalConfigurationDelete(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) - if session.http_response.status_code in [204]: - return self.on_204(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/portals/default", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "serviceName", self.ctx.args.service_name, - 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", "2024-03-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_show.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_show.py deleted file mode 100644 index 8db86cbee9e..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_show.py +++ /dev/null @@ -1,239 +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( - "apic service portal default show", -) -class Show(AAZCommand): - """Get portal configuration. - - :example: Show APIC Default Portal Configuration - az apic service portal default show -g contoso-resources --service-name contoso - """ - - _aaz_info = { - "version": "2024-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/portals/default", "2024-03-01"], - ] - } - - 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.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.service_name = AAZStrArg( - options=["-s", "--service", "--service-name"], - help="The name of Azure API Center service.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - max_length=90, - min_length=1, - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PortalConfigurationGet(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 PortalConfigurationGet(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.ApiCenter/services/{serviceName}/portals/default", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "serviceName", self.ctx.args.service_name, - 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", "2024-03-01", - 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.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.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authentication = AAZObjectType() - properties.created = AAZStrType() - properties.created_by = AAZStrType( - serialized_name="createdBy", - ) - properties.data_api_host_name = AAZStrType( - serialized_name="dataApiHostName", - ) - properties.enabled = AAZBoolType() - properties.portal_default_host_name = AAZStrType( - serialized_name="portalDefaultHostName", - ) - properties.title = AAZStrType() - properties.updated = AAZStrType() - properties.updated_by = AAZStrType( - serialized_name="updatedBy", - ) - - authentication = cls._schema_on_200.properties.authentication - authentication.azure_ad_instance = AAZStrType( - serialized_name="azureAdInstance", - flags={"read_only": True}, - ) - authentication.client_id = AAZStrType( - serialized_name="clientId", - flags={"required": True}, - ) - authentication.scopes = AAZStrType( - flags={"read_only": True}, - ) - authentication.tenant_id = AAZStrType( - serialized_name="tenantId", - ) - - 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", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_update.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_update.py deleted file mode 100644 index 90bedf84fb2..00000000000 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/portal/default/_update.py +++ /dev/null @@ -1,465 +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( - "apic service portal default update", -) -class Update(AAZCommand): - """Update new or updates existing portal configuration. - - :example: Update Default Portal Configuration - az apic service portal default update -g contoso-resources --service-name contoso --title "Contoso" --enabled false --authentication'{"clientId":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000"}' - """ - - _aaz_info = { - "version": "2024-03-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/portals/default", "2024-03-01"], - ] - } - - AZ_SUPPORT_GENERIC_UPDATE = True - - 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.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.service_name = AAZStrArg( - options=["-s", "--service", "--service-name"], - help="The name of Azure API Center service.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - max_length=90, - min_length=1, - ), - ) - - # define Arg Group "Payload" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Payload", - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.authentication = AAZObjectArg( - options=["--authentication"], - arg_group="Properties", - help="Authentication configuration.", - ) - _args_schema.enabled = AAZBoolArg( - options=["--enabled"], - arg_group="Properties", - help="Flag indicating whether or not portal is enabled.", - nullable=True, - ) - _args_schema.title = AAZStrArg( - options=["--title"], - arg_group="Properties", - help="Portal configuration Title.", - fmt=AAZStrArgFormat( - max_length=50, - ), - ) - - authentication = cls._args_schema.authentication - authentication.client_id = AAZStrArg( - options=["client-id"], - help="The Azure Active Directory application client id.", - fmt=AAZStrArgFormat( - max_length=50, - min_length=1, - ), - ) - authentication.tenant_id = AAZStrArg( - options=["tenant-id"], - help="The Azure Active Directory application Tenant id.", - nullable=True, - fmt=AAZStrArgFormat( - max_length=50, - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PortalConfigurationGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - self.PortalConfigurationCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PortalConfigurationGet(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.ApiCenter/services/{serviceName}/portals/default", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "serviceName", self.ctx.args.service_name, - 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", "2024-03-01", - 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() - _UpdateHelper._build_schema_portal_configuration_response_read(cls._schema_on_200) - - return cls._schema_on_200 - - class PortalConfigurationCreateOrUpdate(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.ApiCenter/services/{serviceName}/portals/default", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "serviceName", self.ctx.args.service_name, - 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", "2024-03-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - 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() - _UpdateHelper._build_schema_portal_configuration_response_read(cls._schema_on_200) - - return cls._schema_on_200 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("authentication", AAZObjectType, ".authentication", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enabled", AAZBoolType, ".enabled") - properties.set_prop("title", AAZStrType, ".title", typ_kwargs={"flags": {"required": True}}) - - authentication = _builder.get(".properties.authentication") - if authentication is not None: - authentication.set_prop("clientId", AAZStrType, ".client_id", typ_kwargs={"flags": {"required": True}}) - authentication.set_prop("tenantId", AAZStrType, ".tenant_id") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_portal_configuration_response_read = None - - @classmethod - def _build_schema_portal_configuration_response_read(cls, _schema): - if cls._schema_portal_configuration_response_read is not None: - _schema.id = cls._schema_portal_configuration_response_read.id - _schema.name = cls._schema_portal_configuration_response_read.name - _schema.properties = cls._schema_portal_configuration_response_read.properties - _schema.system_data = cls._schema_portal_configuration_response_read.system_data - _schema.type = cls._schema_portal_configuration_response_read.type - return - - cls._schema_portal_configuration_response_read = _schema_portal_configuration_response_read = AAZObjectType() - - portal_configuration_response_read = _schema_portal_configuration_response_read - portal_configuration_response_read.id = AAZStrType( - flags={"read_only": True}, - ) - portal_configuration_response_read.name = AAZStrType( - flags={"read_only": True}, - ) - portal_configuration_response_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - portal_configuration_response_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - portal_configuration_response_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_portal_configuration_response_read.properties - properties.authentication = AAZObjectType() - properties.created = AAZStrType() - properties.created_by = AAZStrType( - serialized_name="createdBy", - ) - properties.data_api_host_name = AAZStrType( - serialized_name="dataApiHostName", - ) - properties.enabled = AAZBoolType() - properties.portal_default_host_name = AAZStrType( - serialized_name="portalDefaultHostName", - ) - properties.title = AAZStrType() - properties.updated = AAZStrType() - properties.updated_by = AAZStrType( - serialized_name="updatedBy", - ) - - authentication = _schema_portal_configuration_response_read.properties.authentication - authentication.azure_ad_instance = AAZStrType( - serialized_name="azureAdInstance", - flags={"read_only": True}, - ) - authentication.client_id = AAZStrType( - serialized_name="clientId", - flags={"required": True}, - ) - authentication.scopes = AAZStrType( - flags={"read_only": True}, - ) - authentication.tenant_id = AAZStrType( - serialized_name="tenantId", - ) - - system_data = _schema_portal_configuration_response_read.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", - ) - - _schema.id = cls._schema_portal_configuration_response_read.id - _schema.name = cls._schema_portal_configuration_response_read.name - _schema.properties = cls._schema_portal_configuration_response_read.properties - _schema.system_data = cls._schema_portal_configuration_response_read.system_data - _schema.type = cls._schema_portal_configuration_response_read.type - - -__all__ = ["Update"] diff --git a/src/apic-extension/azext_apic_extension/azext_metadata.json b/src/apic-extension/azext_apic_extension/azext_metadata.json index 24862c32571..0761e47ffb8 100644 --- a/src/apic-extension/azext_apic_extension/azext_metadata.json +++ b/src/apic-extension/azext_apic_extension/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.51.0" + "azext.minCliCoreVersion": "2.56.0" } \ No newline at end of file From 87a17cfce8165125aefe6788e5dfe1b917c6faa4 Mon Sep 17 00:00:00 2001 From: Chaoyi Yuan Date: Mon, 11 Mar 2024 10:30:18 +0800 Subject: [PATCH 2/6] feat: manually use 03-01 API version for importFromApim --- .../aaz/latest/apic/service/_import_from_apim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py index 2e5b2936777..f4454a6c98f 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_import_from_apim.py @@ -22,9 +22,9 @@ class ImportFromApim(AAZCommand): """ _aaz_info = { - "version": "2024-03-15-preview", + "version": "2024-03-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/importfromapim", "2024-03-15-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.apicenter/services/{}/importfromapim", "2024-03-01"], ] } @@ -148,7 +148,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2024-03-15-preview", + "api-version", "2024-03-01", required=True, ), } From f604946696536f6283955ec20c5c9529ace95079 Mon Sep 17 00:00:00 2001 From: Chaoyi Yuan Date: Mon, 11 Mar 2024 10:30:36 +0800 Subject: [PATCH 3/6] docs: update changelog --- src/apic-extension/HISTORY.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apic-extension/HISTORY.rst b/src/apic-extension/HISTORY.rst index b363372830d..f66b3701476 100644 --- a/src/apic-extension/HISTORY.rst +++ b/src/apic-extension/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.0.0b5 ++++++ +* Remove: All portal commands as it should not be exposed to customers. + 1.0.0b4 +++++ * Add: Support for Default Portal configuration and default hostname provisoning deprovisioning commands From c1e81bef9b472fa833b4f2e3291b47d80b699aec Mon Sep 17 00:00:00 2001 From: Chaoyi Yuan Date: Tue, 12 Mar 2024 10:52:23 +0800 Subject: [PATCH 4/6] feat: do not bump min cli version --- src/apic-extension/azext_apic_extension/azext_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apic-extension/azext_apic_extension/azext_metadata.json b/src/apic-extension/azext_apic_extension/azext_metadata.json index 0761e47ffb8..24862c32571 100644 --- a/src/apic-extension/azext_apic_extension/azext_metadata.json +++ b/src/apic-extension/azext_apic_extension/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.56.0" + "azext.minCliCoreVersion": "2.51.0" } \ No newline at end of file From 5b31278dc72021f8d07cc840c458000cdaabcc5d Mon Sep 17 00:00:00 2001 From: Chaoyi Yuan Date: Tue, 12 Mar 2024 13:44:52 +0800 Subject: [PATCH 5/6] feat: add dataApiHostname back for apic service create/list/show/update --- .../aaz/latest/apic/service/_create.py | 4 ++++ .../azext_apic_extension/aaz/latest/apic/service/_list.py | 8 ++++++++ .../azext_apic_extension/aaz/latest/apic/service/_show.py | 4 ++++ .../aaz/latest/apic/service/_update.py | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py index 7382551b451..5be1e8dc98b 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py @@ -274,6 +274,10 @@ def _build_schema_on_200_201(cls): ) _element = cls._schema_on_200_201.identity.user_assigned_identities.Element + properties.data_api_hostname = AAZStrType( + serialized_name="dataApiHostname", + flags={"read_only": True}, + ) _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py index eabdc18a9da..178d5eef624 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_list.py @@ -214,6 +214,10 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.value.Element.properties + properties.data_api_hostname = AAZStrType( + serialized_name="dataApiHostname", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -382,6 +386,10 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.value.Element.properties + properties.data_api_hostname = AAZStrType( + serialized_name="dataApiHostname", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py index 3cb8512041b..cc45ab554f0 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_show.py @@ -211,6 +211,10 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.properties + properties.data_api_hostname = AAZStrType( + serialized_name="dataApiHostname", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py index 325353c3a0e..e4790148069 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_update.py @@ -421,6 +421,10 @@ def _build_schema_service_read(cls, _schema): ) properties = _schema_service_read.properties + properties.data_api_hostname = AAZStrType( + serialized_name="dataApiHostname", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, From 25331e1be336b64d2219697560a168246c6e4948 Mon Sep 17 00:00:00 2001 From: Chaoyi Yuan Date: Tue, 12 Mar 2024 13:47:03 +0800 Subject: [PATCH 6/6] fix: correct property location for create command --- .../aaz/latest/apic/service/_create.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py index 5be1e8dc98b..6214b70abc6 100644 --- a/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py +++ b/src/apic-extension/azext_apic_extension/aaz/latest/apic/service/_create.py @@ -274,10 +274,6 @@ def _build_schema_on_200_201(cls): ) _element = cls._schema_on_200_201.identity.user_assigned_identities.Element - properties.data_api_hostname = AAZStrType( - serialized_name="dataApiHostname", - flags={"read_only": True}, - ) _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, @@ -288,6 +284,10 @@ def _build_schema_on_200_201(cls): ) properties = cls._schema_on_200_201.properties + properties.data_api_hostname = AAZStrType( + serialized_name="dataApiHostname", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True},