diff --git a/src/edge-action/HISTORY.rst b/src/edge-action/HISTORY.rst index b957b581752..0cfaed62f67 100644 --- a/src/edge-action/HISTORY.rst +++ b/src/edge-action/HISTORY.rst @@ -3,6 +3,11 @@ Release History =============== +1.0.0b3 +++++++ +* Upgrade to API version 2025-12-01-preview +* Remove `add-attachment` and `delete-attachment` commands (no longer supported in new API version) + 1.0.0b2 ++++++ * Fix 415 Unsupported Media Type error for `get-version-code` and `swap-default` POST operations by adding required Content-Type header and empty JSON body diff --git a/src/edge-action/azext_edge_action/aaz/latest/edge_action/__init__.py b/src/edge-action/azext_edge_action/aaz/latest/edge_action/__init__.py index 9dce1ad9ce0..db73033039b 100644 --- a/src/edge-action/azext_edge_action/aaz/latest/edge_action/__init__.py +++ b/src/edge-action/azext_edge_action/aaz/latest/edge_action/__init__.py @@ -9,10 +9,8 @@ # flake8: noqa from .__cmd_group import * -from ._add_attachment import * from ._create import * from ._delete import * -from ._delete_attachment import * from ._list import * from ._show import * from ._update import * diff --git a/src/edge-action/azext_edge_action/aaz/latest/edge_action/_add_attachment.py b/src/edge-action/azext_edge_action/aaz/latest/edge_action/_add_attachment.py deleted file mode 100644 index 3bc46ab8b39..00000000000 --- a/src/edge-action/azext_edge_action/aaz/latest/edge_action/_add_attachment.py +++ /dev/null @@ -1,213 +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( - "edge-action add-attachment", -) -class AddAttachment(AAZCommand): - """A long-running operation for adding an EdgeAction attachment. - - :example: EdgeActions_AddAttachment - az edge-action add-attachment --resource-group testrg --edge-action-name edgeAction1 --attached-resource-id /subscriptions/sub1/resourceGroups/rs1/providers/Microsoft.Cdn/Profiles/myProfile/afdEndpoints/ep1/routes/route1 - """ - - _aaz_info = { - "version": "2025-09-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/edgeactions/{}/addattachment", "2025-09-01-preview"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(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.edge_action_name = AAZStrArg( - options=["--edge-action-name"], - help="The name of the Edge Action", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - pattern="[a-zA-Z0-9]+", - max_length=50, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Body" - - _args_schema = cls._args_schema - _args_schema.attached_resource_id = AAZResourceIdArg( - options=["--attached-resource-id"], - arg_group="Body", - help="The attached resource Id", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.EdgeActionsAddAttachment(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 EdgeActionsAddAttachment(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, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - 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, - self.on_error, - lro_options={"final-state-via": "location"}, - 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.Cdn/edgeActions/{edgeActionName}/addAttachment", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "edgeActionName", self.ctx.args.edge_action_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", "2025-09-01-preview", - 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("attachedResourceId", AAZStrType, ".attached_resource_id", typ_kwargs={"flags": {"required": True}}) - - 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.edge_action_id = AAZStrType( - serialized_name="edgeActionId", - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _AddAttachmentHelper: - """Helper class for AddAttachment""" - - -__all__ = ["AddAttachment"] diff --git a/src/edge-action/azext_edge_action/aaz/latest/edge_action/_delete_attachment.py b/src/edge-action/azext_edge_action/aaz/latest/edge_action/_delete_attachment.py deleted file mode 100644 index c938f30e3c0..00000000000 --- a/src/edge-action/azext_edge_action/aaz/latest/edge_action/_delete_attachment.py +++ /dev/null @@ -1,196 +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( - "edge-action delete-attachment", -) -class DeleteAttachment(AAZCommand): - """A long-running operation for deleting an EdgeAction attachment that returns no content. - - :example: EdgeActions_DeleteAttachment - az edge-action delete-attachment --resource-group testrg --edge-action-name edgeAction1 --attached-resource-id /subscriptions/sub1/resourceGroups/rs1/providers/Microsoft.Cdn/Profiles/myProfile/afdEndpoints/ep1/routes/route1 - """ - - _aaz_info = { - "version": "2025-09-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/edgeactions/{}/deleteattachment", "2025-09-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.edge_action_name = AAZStrArg( - options=["--edge-action-name"], - help="The name of the Edge Action", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - pattern="[a-zA-Z0-9]+", - max_length=50, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Body" - - _args_schema = cls._args_schema - _args_schema.attached_resource_id = AAZResourceIdArg( - options=["--attached-resource-id"], - arg_group="Body", - help="The attached resource Id", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.EdgeActionsDeleteAttachment(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class EdgeActionsDeleteAttachment(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, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "location"}, - 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.Cdn/edgeActions/{edgeActionName}/deleteAttachment", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "edgeActionName", self.ctx.args.edge_action_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", "2025-09-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "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("attachedResourceId", AAZStrType, ".attached_resource_id", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_204(self, session): - pass - - def on_200_201(self, session): - pass - - -class _DeleteAttachmentHelper: - """Helper class for DeleteAttachment""" - - -__all__ = ["DeleteAttachment"] diff --git a/src/edge-action/setup.py b/src/edge-action/setup.py index fb0f0501191..b4e1bbe75cd 100644 --- a/src/edge-action/setup.py +++ b/src/edge-action/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0b2' +VERSION = '1.0.0b3' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers