diff --git a/src/computelimit/HISTORY.rst b/src/computelimit/HISTORY.rst index a5c413a223e..9b8911bf684 100644 --- a/src/computelimit/HISTORY.rst +++ b/src/computelimit/HISTORY.rst @@ -3,6 +3,15 @@ Release History =============== +1.2.0 +++++++ +* Add feature commands (list, show, enable, disable). +* Add shared-limit-cap commands (add, remove, show, list, set-member-cap-override) and nested member-cap-override commands (add, remove, show, list). + +1.1.0 +++++++ +* Add trusted-host-subscription commands (add, remove, show, list). + 1.0.0 ++++++ * Stable release of the computelimit extension. diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/__cmd_group.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/__cmd_group.py new file mode 100644 index 00000000000..08a41ebb2e8 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit feature", +) +class __CMDGroup(AAZCommandGroup): + """Manage Feature + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/__init__.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/__init__.py new file mode 100644 index 00000000000..4d2c3a5ff39 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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 ._disable import * +from ._enable import * +from ._list import * +from ._show import * diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_disable.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_disable.py new file mode 100644 index 00000000000..63b4790a1d2 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_disable.py @@ -0,0 +1,295 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit feature disable", +) +class Disable(AAZCommand): + """Disables a compute limit feature for the subscription at the specified location. Requires the Contributor role. + + :example: Disable a compute limit feature + az computelimit feature disable --location eastus --feature-name SharedComputeLimit + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/features/{}/disable", "2026-07-31"], + ] + } + + 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.feature_name = AAZStrArg( + options=["--feature-name"], + help="The name of the Feature", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.FeaturesDisable(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 FeaturesDisable(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}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}/disable", + **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( + "featureName", self.ctx.args.feature_name, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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() + _DisableHelper._build_schema_operation_status_result_read(cls._schema_on_200) + + return cls._schema_on_200 + + +class _DisableHelper: + """Helper class for Disable""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.info = AAZDictType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + info = _schema_error_detail_read.additional_info.Element.info + info.Element = AAZAnyType() + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + _schema_operation_status_result_read = None + + @classmethod + def _build_schema_operation_status_result_read(cls, _schema): + if cls._schema_operation_status_result_read is not None: + _schema.end_time = cls._schema_operation_status_result_read.end_time + _schema.error = cls._schema_operation_status_result_read.error + _schema.id = cls._schema_operation_status_result_read.id + _schema.name = cls._schema_operation_status_result_read.name + _schema.operations = cls._schema_operation_status_result_read.operations + _schema.percent_complete = cls._schema_operation_status_result_read.percent_complete + _schema.resource_id = cls._schema_operation_status_result_read.resource_id + _schema.start_time = cls._schema_operation_status_result_read.start_time + _schema.status = cls._schema_operation_status_result_read.status + return + + cls._schema_operation_status_result_read = _schema_operation_status_result_read = AAZObjectType() + + operation_status_result_read = _schema_operation_status_result_read + operation_status_result_read.end_time = AAZStrType( + serialized_name="endTime", + ) + operation_status_result_read.error = AAZObjectType() + cls._build_schema_error_detail_read(operation_status_result_read.error) + operation_status_result_read.id = AAZStrType() + operation_status_result_read.name = AAZStrType() + operation_status_result_read.operations = AAZListType() + operation_status_result_read.percent_complete = AAZFloatType( + serialized_name="percentComplete", + ) + operation_status_result_read.resource_id = AAZStrType( + serialized_name="resourceId", + flags={"read_only": True}, + ) + operation_status_result_read.start_time = AAZStrType( + serialized_name="startTime", + ) + operation_status_result_read.status = AAZStrType( + flags={"required": True}, + ) + + operations = _schema_operation_status_result_read.operations + operations.Element = AAZObjectType() + cls._build_schema_operation_status_result_read(operations.Element) + + _schema.end_time = cls._schema_operation_status_result_read.end_time + _schema.error = cls._schema_operation_status_result_read.error + _schema.id = cls._schema_operation_status_result_read.id + _schema.name = cls._schema_operation_status_result_read.name + _schema.operations = cls._schema_operation_status_result_read.operations + _schema.percent_complete = cls._schema_operation_status_result_read.percent_complete + _schema.resource_id = cls._schema_operation_status_result_read.resource_id + _schema.start_time = cls._schema_operation_status_result_read.start_time + _schema.status = cls._schema_operation_status_result_read.status + + +__all__ = ["Disable"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_enable.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_enable.py new file mode 100644 index 00000000000..201e1cfc7da --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_enable.py @@ -0,0 +1,318 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit feature enable", +) +class Enable(AAZCommand): + """Enables a compute limit feature for the subscription at the specified location. Requires the Contributor role. + + :example: Enable a compute limit feature + az computelimit feature enable --location eastus --feature-name SharedComputeLimit + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/features/{}/enable", "2026-07-31"], + ] + } + + 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.feature_name = AAZStrArg( + options=["--feature-name"], + help="The name of the Feature", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + + # define Arg Group "Body" + + _args_schema = cls._args_schema + _args_schema.service_tree_id = AAZStrArg( + options=["--service-tree-id"], + arg_group="Body", + help="The Service Tree identifier associated with this feature action.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.FeaturesEnable(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 FeaturesEnable(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}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}/enable", + **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( + "featureName", self.ctx.args.feature_name, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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": {"client_flatten": True}} + ) + _builder.set_prop("serviceTreeId", AAZStrType, ".service_tree_id") + + 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() + _EnableHelper._build_schema_operation_status_result_read(cls._schema_on_200) + + return cls._schema_on_200 + + +class _EnableHelper: + """Helper class for Enable""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.info = AAZDictType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + info = _schema_error_detail_read.additional_info.Element.info + info.Element = AAZAnyType() + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + _schema_operation_status_result_read = None + + @classmethod + def _build_schema_operation_status_result_read(cls, _schema): + if cls._schema_operation_status_result_read is not None: + _schema.end_time = cls._schema_operation_status_result_read.end_time + _schema.error = cls._schema_operation_status_result_read.error + _schema.id = cls._schema_operation_status_result_read.id + _schema.name = cls._schema_operation_status_result_read.name + _schema.operations = cls._schema_operation_status_result_read.operations + _schema.percent_complete = cls._schema_operation_status_result_read.percent_complete + _schema.resource_id = cls._schema_operation_status_result_read.resource_id + _schema.start_time = cls._schema_operation_status_result_read.start_time + _schema.status = cls._schema_operation_status_result_read.status + return + + cls._schema_operation_status_result_read = _schema_operation_status_result_read = AAZObjectType() + + operation_status_result_read = _schema_operation_status_result_read + operation_status_result_read.end_time = AAZStrType( + serialized_name="endTime", + ) + operation_status_result_read.error = AAZObjectType() + cls._build_schema_error_detail_read(operation_status_result_read.error) + operation_status_result_read.id = AAZStrType() + operation_status_result_read.name = AAZStrType() + operation_status_result_read.operations = AAZListType() + operation_status_result_read.percent_complete = AAZFloatType( + serialized_name="percentComplete", + ) + operation_status_result_read.resource_id = AAZStrType( + serialized_name="resourceId", + flags={"read_only": True}, + ) + operation_status_result_read.start_time = AAZStrType( + serialized_name="startTime", + ) + operation_status_result_read.status = AAZStrType( + flags={"required": True}, + ) + + operations = _schema_operation_status_result_read.operations + operations.Element = AAZObjectType() + cls._build_schema_operation_status_result_read(operations.Element) + + _schema.end_time = cls._schema_operation_status_result_read.end_time + _schema.error = cls._schema_operation_status_result_read.error + _schema.id = cls._schema_operation_status_result_read.id + _schema.name = cls._schema_operation_status_result_read.name + _schema.operations = cls._schema_operation_status_result_read.operations + _schema.percent_complete = cls._schema_operation_status_result_read.percent_complete + _schema.resource_id = cls._schema_operation_status_result_read.resource_id + _schema.start_time = cls._schema_operation_status_result_read.start_time + _schema.status = cls._schema_operation_status_result_read.status + + +__all__ = ["Enable"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_list.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_list.py new file mode 100644 index 00000000000..d6c425bcde0 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_list.py @@ -0,0 +1,208 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit feature list", +) +class List(AAZCommand): + """List all compute limit features for the subscription at the specified location. + + :example: List all compute limit features + az computelimit feature list --location eastus + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/features", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FeaturesListBySubscriptionLocationResource(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 FeaturesListBySubscriptionLocationResource(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}/providers/Microsoft.ComputeLimit/locations/{location}/features", + **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( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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", + ) + _schema_on_200.value = AAZListType( + flags={"required": 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.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.state = 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", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_show.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_show.py new file mode 100644 index 00000000000..aa161c8a1d2 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/feature/_show.py @@ -0,0 +1,209 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit feature show", +) +class Show(AAZCommand): + """Get the properties of a compute limit feature. + + :example: Get a compute limit feature + az computelimit feature show --location eastus --feature-name SharedComputeLimit + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/features/{}", "2026-07-31"], + ] + } + + 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.feature_name = AAZStrArg( + options=["-n", "--name", "--feature-name"], + help="The name of the Feature", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.FeaturesGet(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 FeaturesGet(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}/providers/Microsoft.ComputeLimit/locations/{location}/features/{featureName}", + **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( + "featureName", self.ctx.args.feature_name, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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() + _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.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.state = 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", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/__cmd_group.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/__cmd_group.py new file mode 100644 index 00000000000..badb975b03c --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap", +) +class __CMDGroup(AAZCommandGroup): + """Manage Shared Limit Cap + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/__init__.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/__init__.py new file mode 100644 index 00000000000..d9977f1dfec --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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 ._add import * +from ._list import * +from ._remove import * +from ._set_member_cap_override import * +from ._show import * diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_add.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_add.py new file mode 100644 index 00000000000..ac24867c44f --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_add.py @@ -0,0 +1,251 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap add", +) +class Add(AAZCommand): + """Create the shared limit cap configuration for a VM family. + + :example: Add a shared limit cap configuration + az computelimit shared-limit-cap add --location eastus --vm-family-name standardDSv3Family --default-member-cap 10 --is-bounded-cap true + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.vm_family_name = AAZStrArg( + options=["-n", "--name", "--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.default_member_cap = AAZIntArg( + options=["--default-member-cap"], + arg_group="Properties", + help="The default member cap value (in count units). Set to a non-negative integer to apply a cap to all member subscriptions that do not have a per-member override. Omit the property to leave no default cap in effect.", + fmt=AAZIntArgFormat( + minimum=0, + ), + ) + _args_schema.is_bounded_cap = AAZBoolArg( + options=["--is-bounded-cap"], + arg_group="Properties", + help="Controls whether the service validates the aggregate cap against the group limit for the VM family. SUM(caps) is the sum of all per-member overrides' cap values plus `defaultMemberCap` multiplied by the number of member subscriptions without an override. When true, the service rejects any configuration where SUM(caps) exceeds the group limit. When false, SUM(caps) is permitted to exceed the group limit. Enabling this flag is rejected if the current configuration already breaches the group limit; reduce caps first, then enable.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SharedLimitCapsCreateOrUpdate(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 SharedLimitCapsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + 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("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("defaultMemberCap", AAZIntType, ".default_member_cap") + properties.set_prop("isBoundedCap", AAZBoolType, ".is_bounded_cap", typ_kwargs={"flags": {"required": True}}) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.default_member_cap = AAZIntType( + serialized_name="defaultMemberCap", + ) + properties.is_bounded_cap = AAZBoolType( + serialized_name="isBoundedCap", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.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_201 + + +class _AddHelper: + """Helper class for Add""" + + +__all__ = ["Add"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_list.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_list.py new file mode 100644 index 00000000000..b219f0c0998 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_list.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap list", +) +class List(AAZCommand): + """List all shared limit cap configurations visible to the caller's subscription. + + :example: List all shared limit cap configurations + az computelimit shared-limit-cap list --location eastus + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SharedLimitCapsListBySubscriptionLocationResource(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 SharedLimitCapsListBySubscriptionLocationResource(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps", + **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( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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", + ) + _schema_on_200.value = AAZListType( + flags={"required": 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.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.default_member_cap = AAZIntType( + serialized_name="defaultMemberCap", + ) + properties.is_bounded_cap = AAZBoolType( + serialized_name="isBoundedCap", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + 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", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_remove.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_remove.py new file mode 100644 index 00000000000..1431cf4c352 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_remove.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap remove", + confirmation="Are you sure you want to perform this operation?", +) +class Remove(AAZCommand): + """Delete the shared limit cap configuration for a VM family. The caller's subscription is treated as the host subscription. + + :example: Remove a shared limit cap configuration + az computelimit shared-limit-cap remove --location eastus --vm-family-name standardDSv3Family + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.vm_family_name = AAZStrArg( + options=["-n", "--name", "--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SharedLimitCapsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SharedLimitCapsDelete(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _RemoveHelper: + """Helper class for Remove""" + + +__all__ = ["Remove"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_set_member_cap_override.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_set_member_cap_override.py new file mode 100644 index 00000000000..ae79255e9d8 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_set_member_cap_override.py @@ -0,0 +1,243 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap set-member-cap-override", +) +class SetMemberCapOverride(AAZCommand): + """Replaces the full set of per-member cap overrides for this shared limit +cap. The supplied array becomes the new complete set of overrides; +supplying an empty array clears all existing overrides. + + :example: Replace the full set of per-member cap overrides + az computelimit shared-limit-cap set-member-cap-override --location eastus --vm-family-name standardDSv3Family --member-cap-overrides "[{subscription-id:33333333-3333-3333-3333-333333333333,cap:10}]" + + :example: Clear all per-member cap overrides + az computelimit shared-limit-cap set-member-cap-override --location eastus --vm-family-name standardDSv3Family --member-cap-overrides "[]" + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}/setmembercapoverrides", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.vm_family_name = AAZStrArg( + options=["--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + + # define Arg Group "Body" + + _args_schema = cls._args_schema + _args_schema.member_cap_overrides = AAZListArg( + options=["--member-cap-overrides"], + arg_group="Body", + help="The full set of per-member cap overrides to persist for this resource. This call replaces the existing set entirely; supply an empty array (`[]`) to clear all overrides.", + required=True, + ) + + member_cap_overrides = cls._args_schema.member_cap_overrides + member_cap_overrides.Element = AAZObjectArg() + + _element = cls._args_schema.member_cap_overrides.Element + _element.cap = AAZIntArg( + options=["cap"], + help="The cap value in count units for this member subscription.", + required=True, + fmt=AAZIntArgFormat( + minimum=0, + ), + ) + _element.subscription_id = AAZStrArg( + options=["subscription-id"], + help="The member subscription identifier this cap applies to.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SharedLimitCapsSetMemberCapOverrides(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 SharedLimitCapsSetMemberCapOverrides(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}/setMemberCapOverrides", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + 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("memberCapOverrides", AAZListType, ".member_cap_overrides", typ_kwargs={"flags": {"required": True}}) + + member_cap_overrides = _builder.get(".memberCapOverrides") + if member_cap_overrides is not None: + member_cap_overrides.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".memberCapOverrides[]") + if _elements is not None: + _elements.set_prop("cap", AAZIntType, ".cap", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("subscriptionId", AAZStrType, ".subscription_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.member_cap_overrides = AAZListType( + serialized_name="memberCapOverrides", + flags={"required": True}, + ) + + member_cap_overrides = cls._schema_on_200.member_cap_overrides + member_cap_overrides.Element = AAZObjectType() + + _element = cls._schema_on_200.member_cap_overrides.Element + _element.cap = AAZIntType( + flags={"required": True}, + ) + _element.subscription_id = AAZStrType( + serialized_name="subscriptionId", + flags={"required": True}, + ) + + return cls._schema_on_200 + + +class _SetMemberCapOverrideHelper: + """Helper class for SetMemberCapOverride""" + + +__all__ = ["SetMemberCapOverride"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_show.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_show.py new file mode 100644 index 00000000000..ae8d9821ce4 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/_show.py @@ -0,0 +1,215 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap show", +) +class Show(AAZCommand): + """Get the shared limit cap configuration for a VM family, as visible to the caller's subscription. + + :example: Get a shared limit cap configuration + az computelimit shared-limit-cap show --location eastus --vm-family-name standardDSv3Family + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.vm_family_name = AAZStrArg( + options=["-n", "--name", "--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SharedLimitCapsGet(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 SharedLimitCapsGet(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + 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() + _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.default_member_cap = AAZIntType( + serialized_name="defaultMemberCap", + ) + properties.is_bounded_cap = AAZBoolType( + serialized_name="isBoundedCap", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + 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/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/__cmd_group.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/__cmd_group.py new file mode 100644 index 00000000000..e0bb29624b1 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap member-cap-override", +) +class __CMDGroup(AAZCommandGroup): + """Manage Member Cap Override + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/__init__.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/__init__.py new file mode 100644 index 00000000000..79e2d553408 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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 ._add import * +from ._list import * +from ._remove import * +from ._show import * diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_add.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_add.py new file mode 100644 index 00000000000..28d29d6a72a --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_add.py @@ -0,0 +1,254 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap member-cap-override add", +) +class Add(AAZCommand): + """Create the cap override for a single member subscription. + + :example: Add a per-member cap override + az computelimit shared-limit-cap member-cap-override add --location eastus --vm-family-name standardDSv3Family --member-subscription-id 33333333-3333-3333-3333-333333333333 --cap 5 + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}/membercapoverrides/{}", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.member_subscription_id = AAZStrArg( + options=["-n", "--name", "--member-subscription-id"], + help="The name of the MemberCapOverride", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + _args_schema.vm_family_name = AAZStrArg( + options=["--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.cap = AAZIntArg( + options=["--cap"], + arg_group="Properties", + help="The cap value in count units for this member subscription.", + fmt=AAZIntArgFormat( + minimum=0, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MemberCapOverridesCreateOrUpdate(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 MemberCapOverridesCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}/memberCapOverrides/{memberSubscriptionId}", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "memberSubscriptionId", self.ctx.args.member_subscription_id, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + 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("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("cap", AAZIntType, ".cap", typ_kwargs={"flags": {"required": True}}) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.cap = AAZIntType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.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_201 + + +class _AddHelper: + """Helper class for Add""" + + +__all__ = ["Add"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_list.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_list.py new file mode 100644 index 00000000000..87c864ede0b --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_list.py @@ -0,0 +1,222 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap member-cap-override list", +) +class List(AAZCommand): + """List all per-member cap overrides configured under a SharedLimitCap. + + :example: List all per-member cap overrides + az computelimit shared-limit-cap member-cap-override list --location eastus --vm-family-name standardDSv3Family + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}/membercapoverrides", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + ) + _args_schema.vm_family_name = AAZStrArg( + options=["--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MemberCapOverridesListByParent(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 MemberCapOverridesListByParent(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}/memberCapOverrides", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + 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", + ) + _schema_on_200.value = AAZListType( + flags={"required": 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.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.cap = AAZIntType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + 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", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_remove.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_remove.py new file mode 100644 index 00000000000..9f418897ed2 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_remove.py @@ -0,0 +1,156 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap member-cap-override remove", + confirmation="Are you sure you want to perform this operation?", +) +class Remove(AAZCommand): + """Delete the per-member cap override for a member subscription. + + :example: Remove a per-member cap override + az computelimit shared-limit-cap member-cap-override remove --location eastus --vm-family-name standardDSv3Family --member-subscription-id 33333333-3333-3333-3333-333333333333 + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}/membercapoverrides/{}", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.member_subscription_id = AAZStrArg( + options=["-n", "--name", "--member-subscription-id"], + help="The name of the MemberCapOverride", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + _args_schema.vm_family_name = AAZStrArg( + options=["--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MemberCapOverridesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class MemberCapOverridesDelete(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}/memberCapOverrides/{memberSubscriptionId}", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "memberSubscriptionId", self.ctx.args.member_subscription_id, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _RemoveHelper: + """Helper class for Remove""" + + +__all__ = ["Remove"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_show.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_show.py new file mode 100644 index 00000000000..34cea112d46 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/shared_limit_cap/member_cap_override/_show.py @@ -0,0 +1,224 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit shared-limit-cap member-cap-override show", +) +class Show(AAZCommand): + """Get the cap override configured for a single member subscription. + + :example: Get a per-member cap override + az computelimit shared-limit-cap member-cap-override show --location eastus --vm-family-name standardDSv3Family --member-subscription-id 33333333-3333-3333-3333-333333333333 + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/sharedlimitcaps/{}/membercapoverrides/{}", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + _args_schema.member_subscription_id = AAZStrArg( + options=["-n", "--name", "--member-subscription-id"], + help="The name of the MemberCapOverride", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + _args_schema.vm_family_name = AAZStrArg( + options=["--vm-family-name"], + help="The name of the SharedLimitCap", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9-]{3,24}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MemberCapOverridesGet(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 MemberCapOverridesGet(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}/providers/Microsoft.ComputeLimit/locations/{location}/sharedLimitCaps/{vmFamilyName}/memberCapOverrides/{memberSubscriptionId}", + **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( + "location", self.ctx.args.location, + required=True, + ), + **self.serialize_url_param( + "memberSubscriptionId", self.ctx.args.member_subscription_id, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + **self.serialize_url_param( + "vmFamilyName", self.ctx.args.vm_family_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-07-31", + 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() + _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.cap = AAZIntType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + 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/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__cmd_group.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__cmd_group.py new file mode 100644 index 00000000000..a3c5da34185 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit trusted-host-subscription", +) +class __CMDGroup(AAZCommandGroup): + """Manage Trusted Host Subscription + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__init__.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__init__.py new file mode 100644 index 00000000000..79e2d553408 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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 ._add import * +from ._list import * +from ._remove import * +from ._show import * diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_add.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_add.py new file mode 100644 index 00000000000..9d2d815e3e7 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_add.py @@ -0,0 +1,217 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit trusted-host-subscription add", +) +class Add(AAZCommand): + """Create a host subscription to the guest subscription's list of trusted hosts. A guest +subscription can trust multiple host subscriptions; this only establishes trust and +does not check the guest in to the host. Guest-to-host association is determined at +check-in time, where a subscription can be a guest of at most one host per region. + + :example: Add a trusted host subscription + az computelimit trusted-host-subscription add --location eastus --host-subscription-id 22222222-2222-2222-2222-222222222222 + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/trustedhostsubscriptions/{}", "2026-07-31"], + ] + } + + 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.host_subscription_id = AAZStrArg( + options=["-n", "--name", "--host-subscription-id"], + help="The name of the TrustedHostSubscription", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrustedHostSubscriptionsCreate(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 TrustedHostSubscriptionsCreate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.ComputeLimit/locations/{location}/trustedHostSubscriptions/{hostSubscriptionId}", + **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( + "hostSubscriptionId", self.ctx.args.host_subscription_id, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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}} + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.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_201 + + +class _AddHelper: + """Helper class for Add""" + + +__all__ = ["Add"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_list.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_list.py new file mode 100644 index 00000000000..b4554988040 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_list.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit trusted-host-subscription list", +) +class List(AAZCommand): + """List all host subscriptions that the guest subscription trusts in a location. + + :example: List all trusted host subscriptions + az computelimit trusted-host-subscription list --location eastus + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/trustedhostsubscriptions", "2026-07-31"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrustedHostSubscriptionsListBySubscriptionLocationResource(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 TrustedHostSubscriptionsListBySubscriptionLocationResource(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}/providers/Microsoft.ComputeLimit/locations/{location}/trustedHostSubscriptions", + **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( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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", + ) + _schema_on_200.value = AAZListType( + flags={"required": 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.name = AAZStrType( + flags={"read_only": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + 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", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_remove.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_remove.py new file mode 100644 index 00000000000..c6926fbdb6b --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_remove.py @@ -0,0 +1,143 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit trusted-host-subscription remove", + confirmation="Are you sure you want to perform this operation?", +) +class Remove(AAZCommand): + """Delete a host subscription from the guest subscription's list of trusted hosts. + + :example: Remove a trusted host subscription + az computelimit trusted-host-subscription remove --location eastus --host-subscription-id 22222222-2222-2222-2222-222222222222 + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/trustedhostsubscriptions/{}", "2026-07-31"], + ] + } + + 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.host_subscription_id = AAZStrArg( + options=["-n", "--name", "--host-subscription-id"], + help="The name of the TrustedHostSubscription", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrustedHostSubscriptionsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class TrustedHostSubscriptionsDelete(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}/providers/Microsoft.ComputeLimit/locations/{location}/trustedHostSubscriptions/{hostSubscriptionId}", + **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( + "hostSubscriptionId", self.ctx.args.host_subscription_id, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + 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", "2026-07-31", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _RemoveHelper: + """Helper class for Remove""" + + +__all__ = ["Remove"] diff --git a/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_show.py b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_show.py new file mode 100644 index 00000000000..b454b735fd7 --- /dev/null +++ b/src/computelimit/azext_computelimit/aaz/latest/computelimit/trusted_host_subscription/_show.py @@ -0,0 +1,201 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "computelimit trusted-host-subscription show", +) +class Show(AAZCommand): + """Get a host subscription that the guest subscription trusts. + + :example: Get a trusted host subscription + az computelimit trusted-host-subscription show --location eastus --host-subscription-id 22222222-2222-2222-2222-222222222222 + """ + + _aaz_info = { + "version": "2026-07-31", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.computelimit/locations/{}/trustedhostsubscriptions/{}", "2026-07-31"], + ] + } + + 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.host_subscription_id = AAZStrArg( + options=["-n", "--name", "--host-subscription-id"], + help="The name of the TrustedHostSubscription", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$", + ), + ) + _args_schema.location = AAZResourceLocationArg( + required=True, + id_part="name", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrustedHostSubscriptionsGet(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 TrustedHostSubscriptionsGet(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}/providers/Microsoft.ComputeLimit/locations/{location}/trustedHostSubscriptions/{hostSubscriptionId}", + **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( + "hostSubscriptionId", self.ctx.args.host_subscription_id, + required=True, + ), + **self.serialize_url_param( + "location", self.ctx.args.location, + 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", "2026-07-31", + 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.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + 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/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_disable.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_disable.yaml new file mode 100644 index 00000000000..9ef81915fb4 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_disable.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit feature disable + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit/disable?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit","name":"SharedComputeLimit","type":"Microsoft.ComputeLimit/locations/features","properties":{"state":"Disabled","provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_enable.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_enable.yaml new file mode 100644 index 00000000000..c24a8ef3178 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_enable.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit feature enable + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit/enable?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit","name":"SharedComputeLimit","type":"Microsoft.ComputeLimit/locations/features","properties":{"state":"Enabled","provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_list.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_list.yaml new file mode 100644 index 00000000000..6a5d563b02e --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_list.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit feature list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features?api-version=2026-07-31 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit","name":"SharedComputeLimit","type":"Microsoft.ComputeLimit/locations/features","properties":{"state":"Enabled","provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_show.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_show.yaml new file mode 100644 index 00000000000..99cecbf5ce9 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_feature_show.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit feature show + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/features/SharedComputeLimit","name":"SharedComputeLimit","type":"Microsoft.ComputeLimit/locations/features","properties":{"state":"Enabled","provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_add.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_add.yaml new file mode 100644 index 00000000000..18a6d80695b --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_add.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"properties":{"cap":5}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap member-cap-override add + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides/33333333-3333-3333-3333-333333333333?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides/33333333-3333-3333-3333-333333333333","name":"33333333-3333-3333-3333-333333333333","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps/memberCapOverrides","properties":{"cap":5,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_list.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_list.yaml new file mode 100644 index 00000000000..fe7f3c3b31b --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_list.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap member-cap-override list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides?api-version=2026-07-31 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides/33333333-3333-3333-3333-333333333333","name":"33333333-3333-3333-3333-333333333333","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps/memberCapOverrides","properties":{"cap":5,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_remove.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_remove.yaml new file mode 100644 index 00000000000..4db008d21b6 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_remove.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap member-cap-override remove + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides/33333333-3333-3333-3333-333333333333?api-version=2026-07-31 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_show.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_show.yaml new file mode 100644 index 00000000000..2e9924422ee --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_member_cap_override_show.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap member-cap-override show + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides/33333333-3333-3333-3333-333333333333?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/memberCapOverrides/33333333-3333-3333-3333-333333333333","name":"33333333-3333-3333-3333-333333333333","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps/memberCapOverrides","properties":{"cap":5,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_add.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_add.yaml new file mode 100644 index 00000000000..e19913b951a --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_add.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"properties":{"defaultMemberCap":10,"isBoundedCap":true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap add + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family","name":"standardDSv3Family","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps","properties":{"defaultMemberCap":10,"isBoundedCap":true,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_list.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_list.yaml new file mode 100644 index 00000000000..049e1e51e4f --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_list.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps?api-version=2026-07-31 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family","name":"standardDSv3Family","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps","properties":{"defaultMemberCap":10,"isBoundedCap":true,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_remove.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_remove.yaml new file mode 100644 index 00000000000..c1604e79010 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_remove.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap remove + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family?api-version=2026-07-31 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_set_member_cap_override.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_set_member_cap_override.yaml new file mode 100644 index 00000000000..5d1125361be --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_set_member_cap_override.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap set-member-cap-override + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family/setMemberCapOverrides?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family","name":"standardDSv3Family","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps","properties":{"defaultMemberCap":10,"isBoundedCap":true,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_show.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_show.yaml new file mode 100644 index 00000000000..6b19def2bbe --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_shared_limit_cap_show.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit shared-limit-cap show + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/sharedLimitCaps/standardDSv3Family","name":"standardDSv3Family","type":"Microsoft.ComputeLimit/locations/sharedLimitCaps","properties":{"defaultMemberCap":10,"isBoundedCap":true,"provisioningState":"Succeeded"},"systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_add.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_add.yaml new file mode 100644 index 00000000000..03807ca52df --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_add.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription add + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222","name":"22222222-2222-2222-2222-222222222222","type":"Microsoft.ComputeLimit/locations/trustedHostSubscriptions","systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_crud.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_crud.yaml new file mode 100644 index 00000000000..5f066728940 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_crud.yaml @@ -0,0 +1,148 @@ +interactions: +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription add + Connection: + - keep-alive + Content-Type: + - application/json + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222","name":"22222222-2222-2222-2222-222222222222","type":"Microsoft.ComputeLimit/locations/trustedHostSubscriptions","systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription show + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222","name":"22222222-2222-2222-2222-222222222222","type":"Microsoft.ComputeLimit/locations/trustedHostSubscriptions","systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions?api-version=2026-07-31 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222","name":"22222222-2222-2222-2222-222222222222","type":"Microsoft.ComputeLimit/locations/trustedHostSubscriptions","systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription remove + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222?api-version=2026-07-31 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 24 Mar 2026 12:00:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_list.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_list.yaml new file mode 100644 index 00000000000..1b9d078dee9 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_list.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions?api-version=2026-07-31 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222","name":"22222222-2222-2222-2222-222222222222","type":"Microsoft.ComputeLimit/locations/trustedHostSubscriptions","systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}]}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_remove.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_remove.yaml new file mode 100644 index 00000000000..0d3c4a44e32 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_remove.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription remove + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222?api-version=2026-07-31 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 24 Mar 2026 12:00:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_show.yaml b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_show.yaml new file mode 100644 index 00000000000..1b1709ed168 --- /dev/null +++ b/src/computelimit/azext_computelimit/tests/latest/recordings/test_computelimit_trusted_host_subscription_show.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - computelimit trusted-host-subscription show + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.84.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-10-10.0.26100-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222?api-version=2026-07-31 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ComputeLimit/locations/eastus/trustedHostSubscriptions/22222222-2222-2222-2222-222222222222","name":"22222222-2222-2222-2222-222222222222","type":"Microsoft.ComputeLimit/locations/trustedHostSubscriptions","systemData":{"createdBy":"user@contoso.com","createdByType":"User","createdAt":"2025-03-01T00:00:00.0000000Z","lastModifiedBy":"user@contoso.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-01T00:00:00.0000000Z"}}' + headers: + cache-control: + - no-cache + content-type: + - application/json; charset=utf-8 + date: + - Mon, 24 Mar 2026 12:00:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py b/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py index 43a2dc21f1f..958d806a1c2 100644 --- a/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py +++ b/src/computelimit/azext_computelimit/tests/latest/test_computelimit.py @@ -291,3 +291,351 @@ def test_computelimit_guest_subscription_add_missing_location(self): 'az computelimit guest-subscription add ' '--guest-subscription-id 11111111-1111-1111-1111-111111111111' ) + + # ============================================= + # Trusted Host Subscription Tests + # ============================================= + + @record_only() + def test_computelimit_trusted_host_subscription_list(self): + """Test listing all trusted host subscriptions in a location.""" + self.kwargs.update({ + 'location': 'eastus' + }) + + # List all trusted host subscriptions + result = self.cmd( + 'az computelimit trusted-host-subscription list --location {location}' + ).get_output_in_json() + + # Verify result is a list + self.assertIsInstance(result, list) + + @record_only() + def test_computelimit_trusted_host_subscription_show(self): + """Test showing a specific trusted host subscription.""" + self.kwargs.update({ + 'location': 'eastus', + 'host_subscription_id': '22222222-2222-2222-2222-222222222222' + }) + + # Show a trusted host subscription + result = self.cmd( + 'az computelimit trusted-host-subscription show --location {location} --host-subscription-id {host_subscription_id}', + checks=[ + self.check('name', '{host_subscription_id}') + ] + ).get_output_in_json() + + # Verify response contains expected fields + self.assertIsNotNone(result) + self.assertIn('name', result) + self.assertIn('id', result) + self.assertIn('type', result) + + @record_only() + def test_computelimit_trusted_host_subscription_add(self): + """Test adding a trusted host subscription.""" + self.kwargs.update({ + 'location': 'eastus', + 'host_subscription_id': '22222222-2222-2222-2222-222222222222' + }) + + # Add a trusted host subscription + result = self.cmd( + 'az computelimit trusted-host-subscription add --location {location} --host-subscription-id {host_subscription_id}', + checks=[ + self.check('name', '{host_subscription_id}') + ] + ).get_output_in_json() + + # Verify response contains expected fields + self.assertIsNotNone(result) + self.assertIn('name', result) + self.assertIn('id', result) + + @record_only() + def test_computelimit_trusted_host_subscription_remove(self): + """Test removing a trusted host subscription.""" + self.kwargs.update({ + 'location': 'eastus', + 'host_subscription_id': '22222222-2222-2222-2222-222222222222' + }) + + # Remove a trusted host subscription (using --yes to skip confirmation) + self.cmd( + 'az computelimit trusted-host-subscription remove --location {location} --host-subscription-id {host_subscription_id} --yes' + ) + + @record_only() + def test_computelimit_trusted_host_subscription_crud(self): + """Test complete CRUD workflow for trusted host subscriptions.""" + self.kwargs.update({ + 'location': 'eastus', + 'host_subscription_id': '22222222-2222-2222-2222-222222222222' + }) + + # Add a trusted host subscription + add_result = self.cmd( + 'az computelimit trusted-host-subscription add --location {location} --host-subscription-id {host_subscription_id}', + checks=[ + self.check('name', '{host_subscription_id}') + ] + ).get_output_in_json() + self.assertIsNotNone(add_result) + + # Show the trusted host subscription + show_result = self.cmd( + 'az computelimit trusted-host-subscription show --location {location} --host-subscription-id {host_subscription_id}', + checks=[ + self.check('name', '{host_subscription_id}') + ] + ).get_output_in_json() + self.assertIsNotNone(show_result) + self.assertEqual(show_result['name'], self.kwargs['host_subscription_id']) + + # List trusted host subscriptions and verify the added subscription is present + list_result = self.cmd( + 'az computelimit trusted-host-subscription list --location {location}' + ).get_output_in_json() + self.assertIsInstance(list_result, list) + names = [item['name'] for item in list_result] + self.assertIn(self.kwargs['host_subscription_id'], names) + + # Remove the trusted host subscription + self.cmd( + 'az computelimit trusted-host-subscription remove --location {location} --host-subscription-id {host_subscription_id} --yes' + ) + + def test_computelimit_trusted_host_subscription_add_invalid_uuid(self): + """Test that an invalid host subscription ID (not a UUID) is rejected.""" + self.kwargs.update({ + 'location': 'eastus', + 'host_subscription_id': 'not-a-valid-uuid' + }) + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az computelimit trusted-host-subscription add --location {location} ' + '--host-subscription-id {host_subscription_id}' + ) + + def test_computelimit_trusted_host_subscription_add_missing_location(self): + """Test that missing required --location parameter is rejected.""" + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az computelimit trusted-host-subscription add ' + '--host-subscription-id 22222222-2222-2222-2222-222222222222' + ) + + # ============================================= + # Feature Tests + # ============================================= + + @record_only() + def test_computelimit_feature_list(self): + """Test listing all compute limit features in a location.""" + self.kwargs.update({ + 'location': 'eastus' + }) + result = self.cmd( + 'az computelimit feature list --location {location}' + ).get_output_in_json() + self.assertIsInstance(result, list) + + @record_only() + def test_computelimit_feature_show(self): + """Test showing a specific compute limit feature.""" + self.kwargs.update({ + 'location': 'eastus', + 'feature_name': 'SharedComputeLimit' + }) + result = self.cmd( + 'az computelimit feature show --location {location} --feature-name {feature_name}', + checks=[ + self.check('name', '{feature_name}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + self.assertIn('name', result) + self.assertIn('id', result) + + @record_only() + def test_computelimit_feature_enable(self): + """Test enabling a compute limit feature.""" + self.kwargs.update({ + 'location': 'eastus', + 'feature_name': 'SharedComputeLimit' + }) + result = self.cmd( + 'az computelimit feature enable --location {location} --feature-name {feature_name}', + checks=[ + self.check('name', '{feature_name}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + + @record_only() + def test_computelimit_feature_disable(self): + """Test disabling a compute limit feature.""" + self.kwargs.update({ + 'location': 'eastus', + 'feature_name': 'SharedComputeLimit' + }) + result = self.cmd( + 'az computelimit feature disable --location {location} --feature-name {feature_name}', + checks=[ + self.check('name', '{feature_name}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + + def test_computelimit_feature_enable_missing_location(self): + """Test that missing required --location parameter is rejected.""" + with self.assertRaises(InvalidArgumentValueError): + self.cmd('az computelimit feature enable --feature-name SharedComputeLimit') + + # ============================================= + # Shared Limit Cap Tests + # ============================================= + + @record_only() + def test_computelimit_shared_limit_cap_list(self): + """Test listing all shared limit cap configurations in a location.""" + self.kwargs.update({ + 'location': 'eastus' + }) + result = self.cmd( + 'az computelimit shared-limit-cap list --location {location}' + ).get_output_in_json() + self.assertIsInstance(result, list) + + @record_only() + def test_computelimit_shared_limit_cap_show(self): + """Test showing a specific shared limit cap configuration.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family' + }) + result = self.cmd( + 'az computelimit shared-limit-cap show --location {location} --vm-family-name {vm_family}', + checks=[ + self.check('name', '{vm_family}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + self.assertIn('name', result) + self.assertIn('id', result) + + @record_only() + def test_computelimit_shared_limit_cap_add(self): + """Test adding a shared limit cap configuration.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family' + }) + result = self.cmd( + 'az computelimit shared-limit-cap add --location {location} --vm-family-name {vm_family} ' + '--default-member-cap 10 --is-bounded-cap true', + checks=[ + self.check('name', '{vm_family}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + + @record_only() + def test_computelimit_shared_limit_cap_remove(self): + """Test removing a shared limit cap configuration.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family' + }) + self.cmd( + 'az computelimit shared-limit-cap remove --location {location} --vm-family-name {vm_family} --yes' + ) + + @record_only() + def test_computelimit_shared_limit_cap_set_member_cap_override(self): + """Test replacing the full set of per-member cap overrides.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family', + 'overrides': '[{subscription-id:33333333-3333-3333-3333-333333333333,cap:10}]' + }) + self.cmd( + 'az computelimit shared-limit-cap set-member-cap-override --location {location} ' + '--vm-family-name {vm_family} --member-cap-overrides "{overrides}"' + ) + + def test_computelimit_shared_limit_cap_add_missing_location(self): + """Test that missing required --location parameter is rejected.""" + with self.assertRaises(InvalidArgumentValueError): + self.cmd('az computelimit shared-limit-cap add --vm-family-name standardDSv3Family') + + # ============================================= + # Member Cap Override Tests + # ============================================= + + @record_only() + def test_computelimit_member_cap_override_list(self): + """Test listing all per-member cap overrides under a shared limit cap.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family' + }) + result = self.cmd( + 'az computelimit shared-limit-cap member-cap-override list ' + '--location {location} --vm-family-name {vm_family}' + ).get_output_in_json() + self.assertIsInstance(result, list) + + @record_only() + def test_computelimit_member_cap_override_show(self): + """Test showing a specific per-member cap override.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family', + 'member_subscription_id': '33333333-3333-3333-3333-333333333333' + }) + result = self.cmd( + 'az computelimit shared-limit-cap member-cap-override show ' + '--location {location} --vm-family-name {vm_family} ' + '--member-subscription-id {member_subscription_id}', + checks=[ + self.check('name', '{member_subscription_id}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + self.assertIn('name', result) + self.assertIn('id', result) + + @record_only() + def test_computelimit_member_cap_override_add(self): + """Test adding a per-member cap override.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family', + 'member_subscription_id': '33333333-3333-3333-3333-333333333333' + }) + result = self.cmd( + 'az computelimit shared-limit-cap member-cap-override add ' + '--location {location} --vm-family-name {vm_family} ' + '--member-subscription-id {member_subscription_id} --cap 5', + checks=[ + self.check('name', '{member_subscription_id}') + ] + ).get_output_in_json() + self.assertIsNotNone(result) + + @record_only() + def test_computelimit_member_cap_override_remove(self): + """Test removing a per-member cap override.""" + self.kwargs.update({ + 'location': 'eastus', + 'vm_family': 'standardDSv3Family', + 'member_subscription_id': '33333333-3333-3333-3333-333333333333' + }) + self.cmd( + 'az computelimit shared-limit-cap member-cap-override remove ' + '--location {location} --vm-family-name {vm_family} ' + '--member-subscription-id {member_subscription_id} --yes' + ) diff --git a/src/computelimit/setup.py b/src/computelimit/setup.py index 690ad308cbf..07fbcf22b25 100644 --- a/src/computelimit/setup.py +++ b/src/computelimit/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '1.2.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers