From 36fcd5336e808eff49fa0f534d39968ba93219a0 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Wed, 8 Jul 2026 22:12:57 +0000 Subject: [PATCH 01/11] Add az aks inference commands for AI Manager Add new 'az aks inference' command group (create/delete/list/show) mapping to the Microsoft.ContainerService/aiManagers resource, plus the 'az aks inference namespace' subgroup for AIManagerNamespace child resources, targeting api-version 2026-04-02-preview. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../aaz/latest/aks/inference/__cmd_group.py | 24 + .../aaz/latest/aks/inference/__init__.py | 15 + .../aaz/latest/aks/inference/_create.py | 411 ++++++++++++++++++ .../aaz/latest/aks/inference/_delete.py | 164 +++++++ .../aaz/latest/aks/inference/_list.py | 380 ++++++++++++++++ .../aaz/latest/aks/inference/_show.py | 284 ++++++++++++ .../aks/inference/namespace/__cmd_group.py | 24 + .../aks/inference/namespace/__init__.py | 15 + .../latest/aks/inference/namespace/_create.py | 320 ++++++++++++++ .../latest/aks/inference/namespace/_delete.py | 174 ++++++++ .../latest/aks/inference/namespace/_list.py | 231 ++++++++++ .../latest/aks/inference/namespace/_show.py | 252 +++++++++++ 12 files changed, 2294 insertions(+) create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py create mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py new file mode 100644 index 00000000000..f52eff4131e --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage AI Manager resources for inference on AKS. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__init__.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__init__.py new file mode 100644 index 00000000000..efc3964e3fb --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__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 ._create import * +from ._delete import * +from ._list import * +from ._show import * diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py new file mode 100644 index 00000000000..4b02308e095 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py @@ -0,0 +1,411 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference create", + is_preview=True, +) +class Create(AAZCommand): + """Create an AI Manager resource. + + :example: Create an AI Manager + az aks inference create --name my-ai-manager -g myrg -l eastus2 + + :example: Create an AI Manager with a system-assigned managed identity and Keep delete policy + az aks inference create --name my-ai-manager -g myrg -l eastus2 --mi-system-assigned --delete-policy Keep + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}", "2026-04-02-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the AI Manager resource.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,61}[a-zA-Z0-9]$", + ), + ) + + # define Arg Group "Identity" + + _args_schema = cls._args_schema + _args_schema.mi_system_assigned = AAZStrArg( + options=["--system-assigned", "--mi-system-assigned"], + arg_group="Identity", + help="Set the system managed identity.", + blank="True", + ) + _args_schema.identity_type = AAZStrArg( + options=["--identity-type"], + arg_group="Identity", + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, + ) + _args_schema.mi_user_assigned = AAZListArg( + options=["--user-assigned", "--mi-user-assigned"], + arg_group="Identity", + help="Set the user managed identities.", + blank=[], + ) + _args_schema.user_assigned_identities = AAZDictArg( + options=["--assigned-identities", "--user-assigned-identities"], + arg_group="Identity", + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + ) + + mi_user_assigned = cls._args_schema.mi_user_assigned + mi_user_assigned.Element = AAZStrArg() + + user_assigned_identities = cls._args_schema.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + blank={}, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.delete_policy = AAZStrArg( + options=["--delete-policy"], + arg_group="Properties", + help="Delete options of the AI Manager. Defaults to Delete if not specified. 'Keep' retains the underlying cluster resources when the AI Manager is deleted.", + enum={"Delete": "Delete", "Keep": "Keep"}, + ) + + # define Arg Group "Resource" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Resource", + help="The geo-location where the resource lives.", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Resource", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.AIManagersCreateOrUpdate(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 AIManagersCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", + **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( + "aiManagerName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("identity", AAZIdentityObjectType) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}}) + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}}) + identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}}) + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + user_assigned = _builder.get(".identity.userAssigned") + if user_assigned is not None: + user_assigned.set_elements(AAZStrType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("deletePolicy", AAZStrType, ".delete_policy") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + 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() + _CreateHelper._build_schema_ai_manager_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + _schema_ai_manager_read = None + + @classmethod + def _build_schema_ai_manager_read(cls, _schema): + if cls._schema_ai_manager_read is not None: + _schema.e_tag = cls._schema_ai_manager_read.e_tag + _schema.id = cls._schema_ai_manager_read.id + _schema.identity = cls._schema_ai_manager_read.identity + _schema.location = cls._schema_ai_manager_read.location + _schema.name = cls._schema_ai_manager_read.name + _schema.properties = cls._schema_ai_manager_read.properties + _schema.system_data = cls._schema_ai_manager_read.system_data + _schema.tags = cls._schema_ai_manager_read.tags + _schema.type = cls._schema_ai_manager_read.type + return + + cls._schema_ai_manager_read = _schema_ai_manager_read = AAZObjectType() + + ai_manager_read = _schema_ai_manager_read + ai_manager_read.e_tag = AAZStrType( + serialized_name="eTag", + flags={"read_only": True}, + ) + ai_manager_read.id = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_read.identity = AAZIdentityObjectType() + ai_manager_read.location = AAZStrType( + flags={"required": True}, + ) + ai_manager_read.name = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + ai_manager_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + ai_manager_read.tags = AAZDictType() + ai_manager_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_ai_manager_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_ai_manager_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_ai_manager_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_ai_manager_read.properties + properties.delete_policy = AAZStrType( + serialized_name="deletePolicy", + ) + properties.managed_resource_group_name = AAZStrType( + serialized_name="managedResourceGroupName", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = _schema_ai_manager_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_ai_manager_read.tags + tags.Element = AAZStrType() + + _schema.e_tag = cls._schema_ai_manager_read.e_tag + _schema.id = cls._schema_ai_manager_read.id + _schema.identity = cls._schema_ai_manager_read.identity + _schema.location = cls._schema_ai_manager_read.location + _schema.name = cls._schema_ai_manager_read.name + _schema.properties = cls._schema_ai_manager_read.properties + _schema.system_data = cls._schema_ai_manager_read.system_data + _schema.tags = cls._schema_ai_manager_read.tags + _schema.type = cls._schema_ai_manager_read.type + + +__all__ = ["Create"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py new file mode 100644 index 00000000000..2b1c71e91f5 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py @@ -0,0 +1,164 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference delete", + is_preview=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an AI Manager resource. + + :example: Delete an AI Manager + az aks inference delete --name my-ai-manager -g myrg + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}", "2026-04-02-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the AI Manager resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.AIManagersDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class AIManagersDelete(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 [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", + **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( + "aiManagerName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py new file mode 100644 index 00000000000..b7ae5b21b6d --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py @@ -0,0 +1,380 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference list", + is_preview=True, +) +class List(AAZCommand): + """List AI Manager resources. + + :example: List AI Managers in a resource group + az aks inference list -g myrg + + :example: List all AI Managers in the subscription + az aks inference list + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.containerservice/aimanagers", "2026-04-02-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers", "2026-04-02-preview"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + if condition_0: + self.AIManagersListBySubscription(ctx=self.ctx)() + if condition_1: + self.AIManagersListByResourceGroup(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 AIManagersListBySubscription(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.ContainerService/aiManagers", + **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( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + _ListHelper._build_schema_ai_manager_read(value.Element) + + return cls._schema_on_200 + + class AIManagersListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + _ListHelper._build_schema_ai_manager_read(value.Element) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_ai_manager_read = None + + @classmethod + def _build_schema_ai_manager_read(cls, _schema): + if cls._schema_ai_manager_read is not None: + _schema.e_tag = cls._schema_ai_manager_read.e_tag + _schema.id = cls._schema_ai_manager_read.id + _schema.identity = cls._schema_ai_manager_read.identity + _schema.location = cls._schema_ai_manager_read.location + _schema.name = cls._schema_ai_manager_read.name + _schema.properties = cls._schema_ai_manager_read.properties + _schema.system_data = cls._schema_ai_manager_read.system_data + _schema.tags = cls._schema_ai_manager_read.tags + _schema.type = cls._schema_ai_manager_read.type + return + + cls._schema_ai_manager_read = _schema_ai_manager_read = AAZObjectType() + + ai_manager_read = _schema_ai_manager_read + ai_manager_read.e_tag = AAZStrType( + serialized_name="eTag", + flags={"read_only": True}, + ) + ai_manager_read.id = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_read.identity = AAZIdentityObjectType() + ai_manager_read.location = AAZStrType( + flags={"required": True}, + ) + ai_manager_read.name = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + ai_manager_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + ai_manager_read.tags = AAZDictType() + ai_manager_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_ai_manager_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_ai_manager_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_ai_manager_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_ai_manager_read.properties + properties.delete_policy = AAZStrType( + serialized_name="deletePolicy", + ) + properties.managed_resource_group_name = AAZStrType( + serialized_name="managedResourceGroupName", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = _schema_ai_manager_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_ai_manager_read.tags + tags.Element = AAZStrType() + + _schema.e_tag = cls._schema_ai_manager_read.e_tag + _schema.id = cls._schema_ai_manager_read.id + _schema.identity = cls._schema_ai_manager_read.identity + _schema.location = cls._schema_ai_manager_read.location + _schema.name = cls._schema_ai_manager_read.name + _schema.properties = cls._schema_ai_manager_read.properties + _schema.system_data = cls._schema_ai_manager_read.system_data + _schema.tags = cls._schema_ai_manager_read.tags + _schema.type = cls._schema_ai_manager_read.type + + +__all__ = ["List"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py new file mode 100644 index 00000000000..4d32d74b1ad --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py @@ -0,0 +1,284 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference show", + is_preview=True, +) +class Show(AAZCommand): + """Show the details of an AI Manager resource. + + :example: Show an AI Manager + az aks inference show --name my-ai-manager -g myrg + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}", "2026-04-02-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the AI Manager resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AIManagersGet(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 AIManagersGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", + **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( + "aiManagerName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _ShowHelper._build_schema_ai_manager_read(cls._schema_on_200) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_ai_manager_read = None + + @classmethod + def _build_schema_ai_manager_read(cls, _schema): + if cls._schema_ai_manager_read is not None: + _schema.e_tag = cls._schema_ai_manager_read.e_tag + _schema.id = cls._schema_ai_manager_read.id + _schema.identity = cls._schema_ai_manager_read.identity + _schema.location = cls._schema_ai_manager_read.location + _schema.name = cls._schema_ai_manager_read.name + _schema.properties = cls._schema_ai_manager_read.properties + _schema.system_data = cls._schema_ai_manager_read.system_data + _schema.tags = cls._schema_ai_manager_read.tags + _schema.type = cls._schema_ai_manager_read.type + return + + cls._schema_ai_manager_read = _schema_ai_manager_read = AAZObjectType() + + ai_manager_read = _schema_ai_manager_read + ai_manager_read.e_tag = AAZStrType( + serialized_name="eTag", + flags={"read_only": True}, + ) + ai_manager_read.id = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_read.identity = AAZIdentityObjectType() + ai_manager_read.location = AAZStrType( + flags={"required": True}, + ) + ai_manager_read.name = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + ai_manager_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + ai_manager_read.tags = AAZDictType() + ai_manager_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_ai_manager_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_ai_manager_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_ai_manager_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_ai_manager_read.properties + properties.delete_policy = AAZStrType( + serialized_name="deletePolicy", + ) + properties.managed_resource_group_name = AAZStrType( + serialized_name="managedResourceGroupName", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = _schema_ai_manager_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_ai_manager_read.tags + tags.Element = AAZStrType() + + _schema.e_tag = cls._schema_ai_manager_read.e_tag + _schema.id = cls._schema_ai_manager_read.id + _schema.identity = cls._schema_ai_manager_read.identity + _schema.location = cls._schema_ai_manager_read.location + _schema.name = cls._schema_ai_manager_read.name + _schema.properties = cls._schema_ai_manager_read.properties + _schema.system_data = cls._schema_ai_manager_read.system_data + _schema.tags = cls._schema_ai_manager_read.tags + _schema.type = cls._schema_ai_manager_read.type + + +__all__ = ["Show"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py new file mode 100644 index 00000000000..18a22a6a676 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference namespace", + is_preview=True, +) +class __CMDGroup(AAZCommandGroup): + """Manage namespaces within an AI Manager. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__init__.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__init__.py new file mode 100644 index 00000000000..efc3964e3fb --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__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 ._create import * +from ._delete import * +from ._list import * +from ._show import * diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py new file mode 100644 index 00000000000..8c2b24892c4 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py @@ -0,0 +1,320 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference namespace create", + is_preview=True, +) +class Create(AAZCommand): + """Create a namespace within an AI Manager. + + :example: Create a namespace + az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha + + :example: Create a namespace with labels and annotations + az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha --labels team=alpha --annotations owner=alice + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces/{}", "2026-04-02-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.ai_manager_name = AAZStrArg( + options=["-m", "--manager", "--ai-manager-name"], + help="The name of the AI Manager resource.", + required=True, + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the AI Manager namespace.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$", + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.annotations = AAZDictArg( + options=["--annotations"], + arg_group="Properties", + help="Annotations applied to the Kubernetes namespace.", + ) + _args_schema.labels = AAZDictArg( + options=["--labels"], + arg_group="Properties", + help="Labels applied to the Kubernetes namespace.", + ) + + annotations = cls._args_schema.annotations + annotations.Element = AAZStrArg() + + labels = cls._args_schema.labels + labels.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.AIManagerNamespacesCreateOrUpdate(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 AIManagerNamespacesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}", + **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( + "aiManagerName", self.ctx.args.ai_manager_name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("annotations", AAZDictType, ".annotations") + properties.set_prop("labels", AAZDictType, ".labels") + + annotations = _builder.get(".properties.annotations") + if annotations is not None: + annotations.set_elements(AAZStrType, ".") + + labels = _builder.get(".properties.labels") + if labels is not None: + labels.set_elements(AAZStrType, ".") + + 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() + _CreateHelper._build_schema_ai_manager_namespace_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + _schema_ai_manager_namespace_read = None + + @classmethod + def _build_schema_ai_manager_namespace_read(cls, _schema): + if cls._schema_ai_manager_namespace_read is not None: + _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag + _schema.id = cls._schema_ai_manager_namespace_read.id + _schema.name = cls._schema_ai_manager_namespace_read.name + _schema.properties = cls._schema_ai_manager_namespace_read.properties + _schema.system_data = cls._schema_ai_manager_namespace_read.system_data + _schema.type = cls._schema_ai_manager_namespace_read.type + return + + cls._schema_ai_manager_namespace_read = _schema_ai_manager_namespace_read = AAZObjectType() + + ai_manager_namespace_read = _schema_ai_manager_namespace_read + ai_manager_namespace_read.e_tag = AAZStrType( + serialized_name="eTag", + flags={"read_only": True}, + ) + ai_manager_namespace_read.id = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_namespace_read.name = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_namespace_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + ai_manager_namespace_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + ai_manager_namespace_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_ai_manager_namespace_read.properties + properties.annotations = AAZDictType() + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + annotations = _schema_ai_manager_namespace_read.properties.annotations + annotations.Element = AAZStrType() + + labels = _schema_ai_manager_namespace_read.properties.labels + labels.Element = AAZStrType() + + system_data = _schema_ai_manager_namespace_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag + _schema.id = cls._schema_ai_manager_namespace_read.id + _schema.name = cls._schema_ai_manager_namespace_read.name + _schema.properties = cls._schema_ai_manager_namespace_read.properties + _schema.system_data = cls._schema_ai_manager_namespace_read.system_data + _schema.type = cls._schema_ai_manager_namespace_read.type + + +__all__ = ["Create"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py new file mode 100644 index 00000000000..1e192bb89b6 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py @@ -0,0 +1,174 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference namespace delete", + is_preview=True, + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a namespace within an AI Manager. + + :example: Delete a namespace + az aks inference namespace delete -m my-ai-manager -g myrg --name team-alpha + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces/{}", "2026-04-02-preview"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.ai_manager_name = AAZStrArg( + options=["-m", "--manager", "--ai-manager-name"], + help="The name of the AI Manager resource.", + required=True, + id_part="name", + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the AI Manager namespace.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.AIManagerNamespacesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class AIManagerNamespacesDelete(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 [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}", + **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( + "aiManagerName", self.ctx.args.ai_manager_name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py new file mode 100644 index 00000000000..7e91bb6c0b1 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py @@ -0,0 +1,231 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference namespace list", + is_preview=True, +) +class List(AAZCommand): + """List the namespaces within an AI Manager. + + :example: List namespaces in an AI Manager + az aks inference namespace list -m my-ai-manager -g myrg + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces", "2026-04-02-preview"], + ] + } + + AZ_SUPPORT_PAGINATION = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.ai_manager_name = AAZStrArg( + options=["-m", "--manager", "--ai-manager-name"], + help="The name of the AI Manager resource.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AIManagerNamespacesListByAIManager(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 AIManagerNamespacesListByAIManager(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces", + **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( + "aiManagerName", self.ctx.args.ai_manager_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _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.e_tag = AAZStrType( + serialized_name="eTag", + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.annotations = AAZDictType() + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + annotations = cls._schema_on_200.value.Element.properties.annotations + annotations.Element = AAZStrType() + + labels = cls._schema_on_200.value.Element.properties.labels + labels.Element = 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/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py new file mode 100644 index 00000000000..7a8bab26097 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py @@ -0,0 +1,252 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "aks inference namespace show", + is_preview=True, +) +class Show(AAZCommand): + """Show the details of a namespace within an AI Manager. + + :example: Show a namespace + az aks inference namespace show -m my-ai-manager -g myrg --name team-alpha + """ + + _aaz_info = { + "version": "2026-04-02-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces/{}", "2026-04-02-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.ai_manager_name = AAZStrArg( + options=["-m", "--manager", "--ai-manager-name"], + help="The name of the AI Manager resource.", + required=True, + id_part="name", + ) + _args_schema.name = AAZStrArg( + options=["-n", "--name"], + help="The name of the AI Manager namespace.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AIManagerNamespacesGet(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 AIManagerNamespacesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}", + **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( + "aiManagerName", self.ctx.args.ai_manager_name, + required=True, + ), + **self.serialize_url_param( + "namespaceName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2026-04-02-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _ShowHelper._build_schema_ai_manager_namespace_read(cls._schema_on_200) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_ai_manager_namespace_read = None + + @classmethod + def _build_schema_ai_manager_namespace_read(cls, _schema): + if cls._schema_ai_manager_namespace_read is not None: + _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag + _schema.id = cls._schema_ai_manager_namespace_read.id + _schema.name = cls._schema_ai_manager_namespace_read.name + _schema.properties = cls._schema_ai_manager_namespace_read.properties + _schema.system_data = cls._schema_ai_manager_namespace_read.system_data + _schema.type = cls._schema_ai_manager_namespace_read.type + return + + cls._schema_ai_manager_namespace_read = _schema_ai_manager_namespace_read = AAZObjectType() + + ai_manager_namespace_read = _schema_ai_manager_namespace_read + ai_manager_namespace_read.e_tag = AAZStrType( + serialized_name="eTag", + flags={"read_only": True}, + ) + ai_manager_namespace_read.id = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_namespace_read.name = AAZStrType( + flags={"read_only": True}, + ) + ai_manager_namespace_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + ai_manager_namespace_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + ai_manager_namespace_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_ai_manager_namespace_read.properties + properties.annotations = AAZDictType() + properties.labels = AAZDictType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + annotations = _schema_ai_manager_namespace_read.properties.annotations + annotations.Element = AAZStrType() + + labels = _schema_ai_manager_namespace_read.properties.labels + labels.Element = AAZStrType() + + system_data = _schema_ai_manager_namespace_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag + _schema.id = cls._schema_ai_manager_namespace_read.id + _schema.name = cls._schema_ai_manager_namespace_read.name + _schema.properties = cls._schema_ai_manager_namespace_read.properties + _schema.system_data = cls._schema_ai_manager_namespace_read.system_data + _schema.type = cls._schema_ai_manager_namespace_read.type + + +__all__ = ["Show"] From c6961398251dab1b7fc7a95d1260e2e7aca9ad64 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Wed, 8 Jul 2026 22:47:19 +0000 Subject: [PATCH 02/11] Switch az aks inference to classic vendored-SDK approach Replace the AAZ-generated 'az aks inference' command files with a hand-written classic module (vendored SDK + custom.py + params + help + explicit command wiring) under azext_aks_preview/aks_inference/. - AIManager (Microsoft.ContainerService/aiManagers) create/show/delete/list - AIManagerNamespace child resource create/show/delete/list - api-version 2026-04-02-preview - Wired into the extension's commands.py, _params.py and _help.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/aks-preview/azext_aks_preview/_help.py | 3 + src/aks-preview/azext_aks_preview/_params.py | 4 + .../aaz/latest/aks/inference/__cmd_group.py | 24 - .../aaz/latest/aks/inference/_create.py | 411 ------------------ .../aaz/latest/aks/inference/_delete.py | 164 ------- .../aaz/latest/aks/inference/_list.py | 380 ---------------- .../aaz/latest/aks/inference/_show.py | 284 ------------ .../aks/inference/namespace/__cmd_group.py | 24 - .../latest/aks/inference/namespace/_create.py | 320 -------------- .../latest/aks/inference/namespace/_delete.py | 174 -------- .../latest/aks/inference/namespace/_list.py | 231 ---------- .../latest/aks/inference/namespace/_show.py | 252 ----------- .../namespace => aks_inference}/__init__.py | 11 - .../aks_inference/_client_factory.py | 22 + .../azext_aks_preview/aks_inference/_help.py | 93 ++++ .../aks_inference/_params.py | 34 ++ .../aks_inference/commands.py | 44 ++ .../azext_aks_preview/aks_inference/custom.py | 77 ++++ .../vendored_sdk}/__init__.py | 12 +- .../aks_inference/vendored_sdk/_client.py | 233 ++++++++++ .../aks_inference/vendored_sdk/models.py | 94 ++++ src/aks-preview/azext_aks_preview/commands.py | 4 + 22 files changed, 611 insertions(+), 2284 deletions(-) delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py delete mode 100644 src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py rename src/aks-preview/azext_aks_preview/{aaz/latest/aks/inference/namespace => aks_inference}/__init__.py (64%) create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/_help.py create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/_params.py create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/commands.py create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/custom.py rename src/aks-preview/azext_aks_preview/{aaz/latest/aks/inference => aks_inference/vendored_sdk}/__init__.py (65%) create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py create mode 100644 src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index cac2a156f5c..c3eaedf4dcf 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -4553,3 +4553,6 @@ - name: Show a specific JWT authenticator configuration text: az aks jwtauthenticator show -g MyResourceGroup --cluster-name MyCluster --name myjwt """ + +# AKS inference (AI Manager) command help - classic vendored-SDK approach +from .aks_inference import _help # noqa: F401,E402 diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index b1c272c44d9..60a4e52319e 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -3247,6 +3247,10 @@ def load_arguments(self, _): help="Show all VM SKU information including those not available for the current subscription.", ) + # AKS inference (AI Manager) commands - classic vendored-SDK approach + from .aks_inference._params import load_arguments as _load_aks_inference_arguments + _load_aks_inference_arguments(self, _) + def _get_default_install_location(exe_name): system = platform.system() diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py deleted file mode 100644 index f52eff4131e..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__cmd_group.py +++ /dev/null @@ -1,24 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "aks inference", - is_preview=True, -) -class __CMDGroup(AAZCommandGroup): - """Manage AI Manager resources for inference on AKS. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py deleted file mode 100644 index 4b02308e095..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_create.py +++ /dev/null @@ -1,411 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference create", - is_preview=True, -) -class Create(AAZCommand): - """Create an AI Manager resource. - - :example: Create an AI Manager - az aks inference create --name my-ai-manager -g myrg -l eastus2 - - :example: Create an AI Manager with a system-assigned managed identity and Keep delete policy - az aks inference create --name my-ai-manager -g myrg -l eastus2 --mi-system-assigned --delete-policy Keep - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}", "2026-04-02-preview"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the AI Manager resource.", - required=True, - fmt=AAZStrArgFormat( - pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,61}[a-zA-Z0-9]$", - ), - ) - - # define Arg Group "Identity" - - _args_schema = cls._args_schema - _args_schema.mi_system_assigned = AAZStrArg( - options=["--system-assigned", "--mi-system-assigned"], - arg_group="Identity", - help="Set the system managed identity.", - blank="True", - ) - _args_schema.identity_type = AAZStrArg( - options=["--identity-type"], - arg_group="Identity", - help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", - enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned, UserAssigned": "SystemAssigned, UserAssigned", "UserAssigned": "UserAssigned"}, - ) - _args_schema.mi_user_assigned = AAZListArg( - options=["--user-assigned", "--mi-user-assigned"], - arg_group="Identity", - help="Set the user managed identities.", - blank=[], - ) - _args_schema.user_assigned_identities = AAZDictArg( - options=["--assigned-identities", "--user-assigned-identities"], - arg_group="Identity", - help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", - ) - - mi_user_assigned = cls._args_schema.mi_user_assigned - mi_user_assigned.Element = AAZStrArg() - - user_assigned_identities = cls._args_schema.user_assigned_identities - user_assigned_identities.Element = AAZObjectArg( - blank={}, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.delete_policy = AAZStrArg( - options=["--delete-policy"], - arg_group="Properties", - help="Delete options of the AI Manager. Defaults to Delete if not specified. 'Keep' retains the underlying cluster resources when the AI Manager is deleted.", - enum={"Delete": "Delete", "Keep": "Keep"}, - ) - - # define Arg Group "Resource" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Resource", - help="The geo-location where the resource lives.", - required=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Resource", - help="Resource tags.", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.AIManagersCreateOrUpdate(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 AIManagersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", - **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( - "aiManagerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("identity", AAZIdentityObjectType) - _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - identity = _builder.get(".identity") - if identity is not None: - identity.set_prop("type", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}}) - identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") - identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}}) - identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}}) - - user_assigned_identities = _builder.get(".identity.userAssignedIdentities") - if user_assigned_identities is not None: - user_assigned_identities.set_elements(AAZObjectType, ".") - - user_assigned = _builder.get(".identity.userAssigned") - if user_assigned is not None: - user_assigned.set_elements(AAZStrType, ".") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("deletePolicy", AAZStrType, ".delete_policy") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - 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() - _CreateHelper._build_schema_ai_manager_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_ai_manager_read = None - - @classmethod - def _build_schema_ai_manager_read(cls, _schema): - if cls._schema_ai_manager_read is not None: - _schema.e_tag = cls._schema_ai_manager_read.e_tag - _schema.id = cls._schema_ai_manager_read.id - _schema.identity = cls._schema_ai_manager_read.identity - _schema.location = cls._schema_ai_manager_read.location - _schema.name = cls._schema_ai_manager_read.name - _schema.properties = cls._schema_ai_manager_read.properties - _schema.system_data = cls._schema_ai_manager_read.system_data - _schema.tags = cls._schema_ai_manager_read.tags - _schema.type = cls._schema_ai_manager_read.type - return - - cls._schema_ai_manager_read = _schema_ai_manager_read = AAZObjectType() - - ai_manager_read = _schema_ai_manager_read - ai_manager_read.e_tag = AAZStrType( - serialized_name="eTag", - flags={"read_only": True}, - ) - ai_manager_read.id = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_read.identity = AAZIdentityObjectType() - ai_manager_read.location = AAZStrType( - flags={"required": True}, - ) - ai_manager_read.name = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - ai_manager_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - ai_manager_read.tags = AAZDictType() - ai_manager_read.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = _schema_ai_manager_read.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = _schema_ai_manager_read.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = _schema_ai_manager_read.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = _schema_ai_manager_read.properties - properties.delete_policy = AAZStrType( - serialized_name="deletePolicy", - ) - properties.managed_resource_group_name = AAZStrType( - serialized_name="managedResourceGroupName", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - system_data = _schema_ai_manager_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = _schema_ai_manager_read.tags - tags.Element = AAZStrType() - - _schema.e_tag = cls._schema_ai_manager_read.e_tag - _schema.id = cls._schema_ai_manager_read.id - _schema.identity = cls._schema_ai_manager_read.identity - _schema.location = cls._schema_ai_manager_read.location - _schema.name = cls._schema_ai_manager_read.name - _schema.properties = cls._schema_ai_manager_read.properties - _schema.system_data = cls._schema_ai_manager_read.system_data - _schema.tags = cls._schema_ai_manager_read.tags - _schema.type = cls._schema_ai_manager_read.type - - -__all__ = ["Create"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py deleted file mode 100644 index 2b1c71e91f5..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_delete.py +++ /dev/null @@ -1,164 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference delete", - is_preview=True, - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete an AI Manager resource. - - :example: Delete an AI Manager - az aks inference delete --name my-ai-manager -g myrg - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}", "2026-04-02-preview"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the AI Manager resource.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.AIManagersDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class AIManagersDelete(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 [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", - **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( - "aiManagerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py deleted file mode 100644 index b7ae5b21b6d..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_list.py +++ /dev/null @@ -1,380 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference list", - is_preview=True, -) -class List(AAZCommand): - """List AI Manager resources. - - :example: List AI Managers in a resource group - az aks inference list -g myrg - - :example: List all AI Managers in the subscription - az aks inference list - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.containerservice/aimanagers", "2026-04-02-preview"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers", "2026-04-02-preview"], - ] - } - - AZ_SUPPORT_PAGINATION = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - if condition_0: - self.AIManagersListBySubscription(ctx=self.ctx)() - if condition_1: - self.AIManagersListByResourceGroup(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 AIManagersListBySubscription(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.ContainerService/aiManagers", - **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( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType( - flags={"required": True}, - ) - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_ai_manager_read(value.Element) - - return cls._schema_on_200 - - class AIManagersListByResourceGroup(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType( - flags={"required": True}, - ) - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_ai_manager_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ai_manager_read = None - - @classmethod - def _build_schema_ai_manager_read(cls, _schema): - if cls._schema_ai_manager_read is not None: - _schema.e_tag = cls._schema_ai_manager_read.e_tag - _schema.id = cls._schema_ai_manager_read.id - _schema.identity = cls._schema_ai_manager_read.identity - _schema.location = cls._schema_ai_manager_read.location - _schema.name = cls._schema_ai_manager_read.name - _schema.properties = cls._schema_ai_manager_read.properties - _schema.system_data = cls._schema_ai_manager_read.system_data - _schema.tags = cls._schema_ai_manager_read.tags - _schema.type = cls._schema_ai_manager_read.type - return - - cls._schema_ai_manager_read = _schema_ai_manager_read = AAZObjectType() - - ai_manager_read = _schema_ai_manager_read - ai_manager_read.e_tag = AAZStrType( - serialized_name="eTag", - flags={"read_only": True}, - ) - ai_manager_read.id = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_read.identity = AAZIdentityObjectType() - ai_manager_read.location = AAZStrType( - flags={"required": True}, - ) - ai_manager_read.name = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - ai_manager_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - ai_manager_read.tags = AAZDictType() - ai_manager_read.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = _schema_ai_manager_read.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = _schema_ai_manager_read.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = _schema_ai_manager_read.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = _schema_ai_manager_read.properties - properties.delete_policy = AAZStrType( - serialized_name="deletePolicy", - ) - properties.managed_resource_group_name = AAZStrType( - serialized_name="managedResourceGroupName", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - system_data = _schema_ai_manager_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = _schema_ai_manager_read.tags - tags.Element = AAZStrType() - - _schema.e_tag = cls._schema_ai_manager_read.e_tag - _schema.id = cls._schema_ai_manager_read.id - _schema.identity = cls._schema_ai_manager_read.identity - _schema.location = cls._schema_ai_manager_read.location - _schema.name = cls._schema_ai_manager_read.name - _schema.properties = cls._schema_ai_manager_read.properties - _schema.system_data = cls._schema_ai_manager_read.system_data - _schema.tags = cls._schema_ai_manager_read.tags - _schema.type = cls._schema_ai_manager_read.type - - -__all__ = ["List"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py deleted file mode 100644 index 4d32d74b1ad..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/_show.py +++ /dev/null @@ -1,284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference show", - is_preview=True, -) -class Show(AAZCommand): - """Show the details of an AI Manager resource. - - :example: Show an AI Manager - az aks inference show --name my-ai-manager -g myrg - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}", "2026-04-02-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the AI Manager resource.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.AIManagersGet(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 AIManagersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", - **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( - "aiManagerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_ai_manager_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ai_manager_read = None - - @classmethod - def _build_schema_ai_manager_read(cls, _schema): - if cls._schema_ai_manager_read is not None: - _schema.e_tag = cls._schema_ai_manager_read.e_tag - _schema.id = cls._schema_ai_manager_read.id - _schema.identity = cls._schema_ai_manager_read.identity - _schema.location = cls._schema_ai_manager_read.location - _schema.name = cls._schema_ai_manager_read.name - _schema.properties = cls._schema_ai_manager_read.properties - _schema.system_data = cls._schema_ai_manager_read.system_data - _schema.tags = cls._schema_ai_manager_read.tags - _schema.type = cls._schema_ai_manager_read.type - return - - cls._schema_ai_manager_read = _schema_ai_manager_read = AAZObjectType() - - ai_manager_read = _schema_ai_manager_read - ai_manager_read.e_tag = AAZStrType( - serialized_name="eTag", - flags={"read_only": True}, - ) - ai_manager_read.id = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_read.identity = AAZIdentityObjectType() - ai_manager_read.location = AAZStrType( - flags={"required": True}, - ) - ai_manager_read.name = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - ai_manager_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - ai_manager_read.tags = AAZDictType() - ai_manager_read.type = AAZStrType( - flags={"read_only": True}, - ) - - identity = _schema_ai_manager_read.identity - identity.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - identity.tenant_id = AAZStrType( - serialized_name="tenantId", - flags={"read_only": True}, - ) - identity.type = AAZStrType( - flags={"required": True}, - ) - identity.user_assigned_identities = AAZDictType( - serialized_name="userAssignedIdentities", - ) - - user_assigned_identities = _schema_ai_manager_read.identity.user_assigned_identities - user_assigned_identities.Element = AAZObjectType() - - _element = _schema_ai_manager_read.identity.user_assigned_identities.Element - _element.client_id = AAZStrType( - serialized_name="clientId", - flags={"read_only": True}, - ) - _element.principal_id = AAZStrType( - serialized_name="principalId", - flags={"read_only": True}, - ) - - properties = _schema_ai_manager_read.properties - properties.delete_policy = AAZStrType( - serialized_name="deletePolicy", - ) - properties.managed_resource_group_name = AAZStrType( - serialized_name="managedResourceGroupName", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - system_data = _schema_ai_manager_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - tags = _schema_ai_manager_read.tags - tags.Element = AAZStrType() - - _schema.e_tag = cls._schema_ai_manager_read.e_tag - _schema.id = cls._schema_ai_manager_read.id - _schema.identity = cls._schema_ai_manager_read.identity - _schema.location = cls._schema_ai_manager_read.location - _schema.name = cls._schema_ai_manager_read.name - _schema.properties = cls._schema_ai_manager_read.properties - _schema.system_data = cls._schema_ai_manager_read.system_data - _schema.tags = cls._schema_ai_manager_read.tags - _schema.type = cls._schema_ai_manager_read.type - - -__all__ = ["Show"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py deleted file mode 100644 index 18a22a6a676..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__cmd_group.py +++ /dev/null @@ -1,24 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "aks inference namespace", - is_preview=True, -) -class __CMDGroup(AAZCommandGroup): - """Manage namespaces within an AI Manager. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py deleted file mode 100644 index 8c2b24892c4..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_create.py +++ /dev/null @@ -1,320 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference namespace create", - is_preview=True, -) -class Create(AAZCommand): - """Create a namespace within an AI Manager. - - :example: Create a namespace - az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha - - :example: Create a namespace with labels and annotations - az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha --labels team=alpha --annotations owner=alice - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces/{}", "2026-04-02-preview"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.ai_manager_name = AAZStrArg( - options=["-m", "--manager", "--ai-manager-name"], - help="The name of the AI Manager resource.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the AI Manager namespace.", - required=True, - fmt=AAZStrArgFormat( - pattern="^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$", - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.annotations = AAZDictArg( - options=["--annotations"], - arg_group="Properties", - help="Annotations applied to the Kubernetes namespace.", - ) - _args_schema.labels = AAZDictArg( - options=["--labels"], - arg_group="Properties", - help="Labels applied to the Kubernetes namespace.", - ) - - annotations = cls._args_schema.annotations - annotations.Element = AAZStrArg() - - labels = cls._args_schema.labels - labels.Element = AAZStrArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.AIManagerNamespacesCreateOrUpdate(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 AIManagerNamespacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}", - **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( - "aiManagerName", self.ctx.args.ai_manager_name, - required=True, - ), - **self.serialize_url_param( - "namespaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("annotations", AAZDictType, ".annotations") - properties.set_prop("labels", AAZDictType, ".labels") - - annotations = _builder.get(".properties.annotations") - if annotations is not None: - annotations.set_elements(AAZStrType, ".") - - labels = _builder.get(".properties.labels") - if labels is not None: - labels.set_elements(AAZStrType, ".") - - 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() - _CreateHelper._build_schema_ai_manager_namespace_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_ai_manager_namespace_read = None - - @classmethod - def _build_schema_ai_manager_namespace_read(cls, _schema): - if cls._schema_ai_manager_namespace_read is not None: - _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag - _schema.id = cls._schema_ai_manager_namespace_read.id - _schema.name = cls._schema_ai_manager_namespace_read.name - _schema.properties = cls._schema_ai_manager_namespace_read.properties - _schema.system_data = cls._schema_ai_manager_namespace_read.system_data - _schema.type = cls._schema_ai_manager_namespace_read.type - return - - cls._schema_ai_manager_namespace_read = _schema_ai_manager_namespace_read = AAZObjectType() - - ai_manager_namespace_read = _schema_ai_manager_namespace_read - ai_manager_namespace_read.e_tag = AAZStrType( - serialized_name="eTag", - flags={"read_only": True}, - ) - ai_manager_namespace_read.id = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_namespace_read.name = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_namespace_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - ai_manager_namespace_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - ai_manager_namespace_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_ai_manager_namespace_read.properties - properties.annotations = AAZDictType() - properties.labels = AAZDictType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - annotations = _schema_ai_manager_namespace_read.properties.annotations - annotations.Element = AAZStrType() - - labels = _schema_ai_manager_namespace_read.properties.labels - labels.Element = AAZStrType() - - system_data = _schema_ai_manager_namespace_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag - _schema.id = cls._schema_ai_manager_namespace_read.id - _schema.name = cls._schema_ai_manager_namespace_read.name - _schema.properties = cls._schema_ai_manager_namespace_read.properties - _schema.system_data = cls._schema_ai_manager_namespace_read.system_data - _schema.type = cls._schema_ai_manager_namespace_read.type - - -__all__ = ["Create"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py deleted file mode 100644 index 1e192bb89b6..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_delete.py +++ /dev/null @@ -1,174 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference namespace delete", - is_preview=True, - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a namespace within an AI Manager. - - :example: Delete a namespace - az aks inference namespace delete -m my-ai-manager -g myrg --name team-alpha - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces/{}", "2026-04-02-preview"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.ai_manager_name = AAZStrArg( - options=["-m", "--manager", "--ai-manager-name"], - help="The name of the AI Manager resource.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the AI Manager namespace.", - required=True, - id_part="child_name_1", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.AIManagerNamespacesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class AIManagerNamespacesDelete(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 [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}", - **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( - "aiManagerName", self.ctx.args.ai_manager_name, - required=True, - ), - **self.serialize_url_param( - "namespaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py deleted file mode 100644 index 7e91bb6c0b1..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_list.py +++ /dev/null @@ -1,231 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference namespace list", - is_preview=True, -) -class List(AAZCommand): - """List the namespaces within an AI Manager. - - :example: List namespaces in an AI Manager - az aks inference namespace list -m my-ai-manager -g myrg - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces", "2026-04-02-preview"], - ] - } - - AZ_SUPPORT_PAGINATION = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.ai_manager_name = AAZStrArg( - options=["-m", "--manager", "--ai-manager-name"], - help="The name of the AI Manager resource.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.AIManagerNamespacesListByAIManager(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 AIManagerNamespacesListByAIManager(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces", - **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( - "aiManagerName", self.ctx.args.ai_manager_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _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.e_tag = AAZStrType( - serialized_name="eTag", - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.annotations = AAZDictType() - properties.labels = AAZDictType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - annotations = cls._schema_on_200.value.Element.properties.annotations - annotations.Element = AAZStrType() - - labels = cls._schema_on_200.value.Element.properties.labels - labels.Element = 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/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py b/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py deleted file mode 100644 index 7a8bab26097..00000000000 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/_show.py +++ /dev/null @@ -1,252 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "aks inference namespace show", - is_preview=True, -) -class Show(AAZCommand): - """Show the details of a namespace within an AI Manager. - - :example: Show a namespace - az aks inference namespace show -m my-ai-manager -g myrg --name team-alpha - """ - - _aaz_info = { - "version": "2026-04-02-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.containerservice/aimanagers/{}/namespaces/{}", "2026-04-02-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.ai_manager_name = AAZStrArg( - options=["-m", "--manager", "--ai-manager-name"], - help="The name of the AI Manager resource.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the AI Manager namespace.", - required=True, - id_part="child_name_1", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.AIManagerNamespacesGet(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 AIManagerNamespacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}", - **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( - "aiManagerName", self.ctx.args.ai_manager_name, - required=True, - ), - **self.serialize_url_param( - "namespaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2026-04-02-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_ai_manager_namespace_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ai_manager_namespace_read = None - - @classmethod - def _build_schema_ai_manager_namespace_read(cls, _schema): - if cls._schema_ai_manager_namespace_read is not None: - _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag - _schema.id = cls._schema_ai_manager_namespace_read.id - _schema.name = cls._schema_ai_manager_namespace_read.name - _schema.properties = cls._schema_ai_manager_namespace_read.properties - _schema.system_data = cls._schema_ai_manager_namespace_read.system_data - _schema.type = cls._schema_ai_manager_namespace_read.type - return - - cls._schema_ai_manager_namespace_read = _schema_ai_manager_namespace_read = AAZObjectType() - - ai_manager_namespace_read = _schema_ai_manager_namespace_read - ai_manager_namespace_read.e_tag = AAZStrType( - serialized_name="eTag", - flags={"read_only": True}, - ) - ai_manager_namespace_read.id = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_namespace_read.name = AAZStrType( - flags={"read_only": True}, - ) - ai_manager_namespace_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - ai_manager_namespace_read.system_data = AAZObjectType( - serialized_name="systemData", - flags={"read_only": True}, - ) - ai_manager_namespace_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_ai_manager_namespace_read.properties - properties.annotations = AAZDictType() - properties.labels = AAZDictType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - annotations = _schema_ai_manager_namespace_read.properties.annotations - annotations.Element = AAZStrType() - - labels = _schema_ai_manager_namespace_read.properties.labels - labels.Element = AAZStrType() - - system_data = _schema_ai_manager_namespace_read.system_data - system_data.created_at = AAZStrType( - serialized_name="createdAt", - ) - system_data.created_by = AAZStrType( - serialized_name="createdBy", - ) - system_data.created_by_type = AAZStrType( - serialized_name="createdByType", - ) - system_data.last_modified_at = AAZStrType( - serialized_name="lastModifiedAt", - ) - system_data.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - ) - system_data.last_modified_by_type = AAZStrType( - serialized_name="lastModifiedByType", - ) - - _schema.e_tag = cls._schema_ai_manager_namespace_read.e_tag - _schema.id = cls._schema_ai_manager_namespace_read.id - _schema.name = cls._schema_ai_manager_namespace_read.name - _schema.properties = cls._schema_ai_manager_namespace_read.properties - _schema.system_data = cls._schema_ai_manager_namespace_read.system_data - _schema.type = cls._schema_ai_manager_namespace_read.type - - -__all__ = ["Show"] diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__init__.py b/src/aks-preview/azext_aks_preview/aks_inference/__init__.py similarity index 64% rename from src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__init__.py rename to src/aks-preview/azext_aks_preview/aks_inference/__init__.py index efc3964e3fb..34913fb394d 100644 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/namespace/__init__.py +++ b/src/aks-preview/azext_aks_preview/aks_inference/__init__.py @@ -1,15 +1,4 @@ # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools # -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._create import * -from ._delete import * -from ._list import * -from ._show import * diff --git a/src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py b/src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py new file mode 100644 index 00000000000..1a5fd05a690 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Client factory — the classic equivalent of `_client_factory.py:22` (cf_managed_clusters).""" + +from azure.cli.core.commands.client_factory import get_mgmt_service_client +from azure.cli.core.profiles import ResourceType # noqa: F401 (real code registers a custom profile) + +from .vendored_sdk import AIManagerMgmtClient + + +def cf_ai_managers(cli_ctx, *_): + # get_mgmt_service_client wires up the credential, subscription id, ARM base url and + # cloud-specific scopes, then instantiates our (vendored) client. + client = get_mgmt_service_client(cli_ctx, AIManagerMgmtClient) + return client.ai_managers + + +def cf_ai_manager_namespaces(cli_ctx, *_): + client = get_mgmt_service_client(cli_ctx, AIManagerMgmtClient) + return client.ai_manager_namespaces diff --git a/src/aks-preview/azext_aks_preview/aks_inference/_help.py b/src/aks-preview/azext_aks_preview/aks_inference/_help.py new file mode 100644 index 00000000000..4da0d8a036a --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/_help.py @@ -0,0 +1,93 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Help definitions — the classic equivalent of `_help.py`. + +Unlike AAZ (where the command class docstring is the help), classic command +modules register help as YAML strings in the `helps` dict. Import this module +once (e.g. from the extension's real `_help.py`) so the strings get registered. +""" + +from knack.help_files import helps + + +helps['aks inference'] = """ + type: group + short-summary: Manage AI Manager resources for inference on AKS. +""" + +helps['aks inference create'] = """ + type: command + short-summary: Create an AI Manager resource. + examples: + - name: Create an AI Manager + text: az aks inference create --name my-ai-manager -g myrg -l eastus2 + - name: Create an AI Manager with the Keep delete policy + text: az aks inference create --name my-ai-manager -g myrg -l eastus2 --delete-policy Keep +""" + +helps['aks inference show'] = """ + type: command + short-summary: Show the details of an AI Manager resource. + examples: + - name: Show an AI Manager + text: az aks inference show --name my-ai-manager -g myrg +""" + +helps['aks inference delete'] = """ + type: command + short-summary: Delete an AI Manager resource. + examples: + - name: Delete an AI Manager + text: az aks inference delete --name my-ai-manager -g myrg +""" + +helps['aks inference list'] = """ + type: command + short-summary: List AI Manager resources. + examples: + - name: List AI Managers in a resource group + text: az aks inference list -g myrg + - name: List all AI Managers in the subscription + text: az aks inference list +""" + +helps['aks inference namespace'] = """ + type: group + short-summary: Manage namespaces within an AI Manager. +""" + +helps['aks inference namespace create'] = """ + type: command + short-summary: Create a namespace within an AI Manager. + examples: + - name: Create a namespace + text: az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha + - name: Create a namespace with labels and annotations + text: az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha --labels team=alpha --annotations owner=alice +""" + +helps['aks inference namespace show'] = """ + type: command + short-summary: Show the details of a namespace within an AI Manager. + examples: + - name: Show a namespace + text: az aks inference namespace show -m my-ai-manager -g myrg --name team-alpha +""" + +helps['aks inference namespace delete'] = """ + type: command + short-summary: Delete a namespace within an AI Manager. + examples: + - name: Delete a namespace + text: az aks inference namespace delete -m my-ai-manager -g myrg --name team-alpha +""" + +helps['aks inference namespace list'] = """ + type: command + short-summary: List the namespaces within an AI Manager. + examples: + - name: List namespaces in an AI Manager + text: az aks inference namespace list -m my-ai-manager -g myrg +""" diff --git a/src/aks-preview/azext_aks_preview/aks_inference/_params.py b/src/aks-preview/azext_aks_preview/aks_inference/_params.py new file mode 100644 index 00000000000..388b8bc42ef --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/_params.py @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Argument definitions — the classic equivalent of `_params.py` load_arguments.""" + +from azure.cli.core.commands.parameters import ( + get_location_type, tags_type, get_enum_type, get_resource_name_completion_list) + + +def load_arguments(self, _): + with self.argument_context('aks inference') as c: + c.argument('ai_manager_name', options_list=['--name', '-n'], + help='The name of the AI Manager resource.', + completer=get_resource_name_completion_list('Microsoft.ContainerService/aiManagers')) + + with self.argument_context('aks inference create') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx)) + c.argument('tags', arg_type=tags_type) + c.argument('delete_policy', arg_type=get_enum_type(['Keep', 'Delete']), + help="Delete options of the AI Manager. Defaults to Delete.") + + with self.argument_context('aks inference list') as c: + c.ignore('ai_manager_name') + + with self.argument_context('aks inference namespace') as c: + c.argument('ai_manager_name', options_list=['--manager', '-m'], + help='The name of the AI Manager resource.') + c.argument('namespace_name', options_list=['--name', '-n'], + help='The name of the AI Manager namespace.') + + with self.argument_context('aks inference namespace create') as c: + c.argument('labels', tags_type, help='Labels applied to the Kubernetes namespace.') + c.argument('annotations', tags_type, help='Annotations applied to the Kubernetes namespace.') diff --git a/src/aks-preview/azext_aks_preview/aks_inference/commands.py b/src/aks-preview/azext_aks_preview/aks_inference/commands.py new file mode 100644 index 00000000000..ad55093fdd2 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/commands.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Command registration — the classic equivalent of the wiring in `commands.py:102`. + +This maps CLI commands to the custom functions and the SDK client factory. It is +NOT auto-loaded; to activate, call `load_command_table(self, _)` from the +extension's real `commands.py` and `load_arguments` from `_params.py`. +""" + +from azure.cli.core.commands import CliCommandType +from .custom import ( + aks_inference_create, aks_inference_show, aks_inference_delete, aks_inference_list) +from ._client_factory import cf_ai_managers, cf_ai_manager_namespaces + + +def load_command_table(self, _): + aimanager_custom = CliCommandType( + operations_tmpl='azext_aks_preview.aks_inference.custom#{}', + client_factory=cf_ai_managers, + ) + + with self.command_group('aks inference', aimanager_custom, + custom_command_type=aimanager_custom, + client_factory=cf_ai_managers, is_preview=True) as g: + g.custom_command('create', 'aks_inference_create', supports_no_wait=True) + g.custom_show_command('show', 'aks_inference_show') + g.custom_command('delete', 'aks_inference_delete', supports_no_wait=True, confirmation=True) + g.custom_command('list', 'aks_inference_list') + + namespace_custom = CliCommandType( + operations_tmpl='azext_aks_preview.aks_inference.custom#{}', + client_factory=cf_ai_manager_namespaces, + ) + + with self.command_group('aks inference namespace', namespace_custom, + custom_command_type=namespace_custom, + client_factory=cf_ai_manager_namespaces, is_preview=True) as g: + g.custom_command('create', 'aks_inference_namespace_create', supports_no_wait=True) + g.custom_show_command('show', 'aks_inference_namespace_show') + g.custom_command('delete', 'aks_inference_namespace_delete', + supports_no_wait=True, confirmation=True) + g.custom_command('list', 'aks_inference_namespace_list') diff --git a/src/aks-preview/azext_aks_preview/aks_inference/custom.py b/src/aks-preview/azext_aks_preview/aks_inference/custom.py new file mode 100644 index 00000000000..c6c075427dc --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/custom.py @@ -0,0 +1,77 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Custom command implementations — the hand-written equivalent of functions in `custom.py`. + +Compare with the AAZ approach: here YOU build the model, call the SDK method, and +return the (poller) result. LRO/paging come from the SDK, not from generated command files. +""" + +from .vendored_sdk import models + + +def aks_inference_create(cmd, client, resource_group_name, ai_manager_name, location=None, + tags=None, delete_policy=None, no_wait=False): + from azure.cli.core.commands import LongRunningOperation + + parameters = models.AIManager( + location=location, + tags=tags, + properties=models.AIManagerProperties(delete_policy=delete_policy), + ) + poller = client.begin_create_or_update(resource_group_name, ai_manager_name, parameters) + if no_wait: + return poller + return LongRunningOperation(cmd.cli_ctx)(poller) + + +def aks_inference_show(cmd, client, resource_group_name, ai_manager_name): + return client.get(resource_group_name, ai_manager_name) + + +def aks_inference_delete(cmd, client, resource_group_name, ai_manager_name, no_wait=False): + from azure.cli.core.commands import LongRunningOperation + + poller = client.begin_delete(resource_group_name, ai_manager_name) + if no_wait: + return poller + return LongRunningOperation(cmd.cli_ctx)(poller) + + +def aks_inference_list(cmd, client, resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list_by_subscription() + + +def aks_inference_namespace_create(cmd, client, resource_group_name, ai_manager_name, + namespace_name, labels=None, annotations=None, no_wait=False): + from azure.cli.core.commands import LongRunningOperation + + parameters = models.AIManagerNamespace( + properties=models.AIManagerNamespaceProperties(labels=labels, annotations=annotations), + ) + poller = client.begin_create_or_update( + resource_group_name, ai_manager_name, namespace_name, parameters) + if no_wait: + return poller + return LongRunningOperation(cmd.cli_ctx)(poller) + + +def aks_inference_namespace_show(cmd, client, resource_group_name, ai_manager_name, namespace_name): + return client.get(resource_group_name, ai_manager_name, namespace_name) + + +def aks_inference_namespace_delete(cmd, client, resource_group_name, ai_manager_name, + namespace_name, no_wait=False): + from azure.cli.core.commands import LongRunningOperation + + poller = client.begin_delete(resource_group_name, ai_manager_name, namespace_name) + if no_wait: + return poller + return LongRunningOperation(cmd.cli_ctx)(poller) + + +def aks_inference_namespace_list(cmd, client, resource_group_name, ai_manager_name): + return client.list_by_ai_manager(resource_group_name, ai_manager_name) diff --git a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__init__.py b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/__init__.py similarity index 65% rename from src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__init__.py rename to src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/__init__.py index efc3964e3fb..41f3467c052 100644 --- a/src/aks-preview/azext_aks_preview/aaz/latest/aks/inference/__init__.py +++ b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/__init__.py @@ -1,15 +1,9 @@ # -------------------------------------------------------------------------------------------- # 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 ._client import AIManagerMgmtClient +from . import models -from .__cmd_group import * -from ._create import * -from ._delete import * -from ._list import * -from ._show import * +__all__ = ["AIManagerMgmtClient", "models"] diff --git a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py new file mode 100644 index 00000000000..608502c4fd7 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py @@ -0,0 +1,233 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Illustrative track2-style client + operations for the AIManager resource. + +Mirrors what AutoRest generates: an ``ARMPipelineClient`` plus an operations +group whose methods build requests, send them through the pipeline, and (for +PUT/DELETE) return an ``LROPoller``. Condensed and hand-written for comparison +with the AAZ approach only. +""" + +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.core.polling import LROPoller +from azure.mgmt.core.polling.arm_polling import ARMPolling +from azure.core.pipeline.transport import HttpRequest +from msrest import Serializer, Deserializer + +from . import models as _models + +API_VERSION = "2026-04-02-preview" + + +class AIManagersOperations: + """Operations for Microsoft.ContainerService/aiManagers.""" + + def __init__(self, client, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + def _url(self, template, **kwargs): + path_args = {k: self._serialize.url(k, v, "str") for k, v in kwargs.items()} + return self._client.format_url(template, **path_args) + + def _query(self): + return {"api-version": self._serialize.query("api_version", API_VERSION, "str")} + + def _headers(self, has_body): + headers = {"Accept": "application/json"} + if has_body: + headers["Content-Type"] = "application/json" + return headers + + def begin_create_or_update(self, resource_group_name, ai_manager_name, parameters, **kwargs): + url = self._url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" + "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + ) + body = self._serialize.body(parameters, "AIManager") + request = HttpRequest("PUT", url, headers=self._headers(True)) + request.format_parameters(self._query()) + request.set_json_body(body) + + def deserialization_callback(pipeline_response): + return self._deserialize("AIManager", pipeline_response.http_response) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + return LROPoller( + self._client, pipeline_response, deserialization_callback, ARMPolling(30, **kwargs) + ) + + def get(self, resource_group_name, ai_manager_name, **kwargs): + url = self._url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" + "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + ) + request = HttpRequest("GET", url, headers=self._headers(False)) + request.format_parameters(self._query()) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + return self._deserialize("AIManager", pipeline_response.http_response) + + def begin_delete(self, resource_group_name, ai_manager_name, **kwargs): + url = self._url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" + "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + ) + request = HttpRequest("DELETE", url, headers=self._headers(False)) + request.format_parameters(self._query()) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + return LROPoller(self._client, pipeline_response, lambda _: None, ARMPolling(30, **kwargs)) + + def list_by_resource_group(self, resource_group_name, **kwargs): + url = self._url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" + "/providers/Microsoft.ContainerService/aiManagers", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + ) + return self._list(url, **kwargs) + + def list_by_subscription(self, **kwargs): + url = self._url( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/aiManagers", + subscriptionId=self._client._subscription_id, + ) + return self._list(url, **kwargs) + + def _list(self, url, **kwargs): + request = HttpRequest("GET", url, headers=self._headers(False)) + request.format_parameters(self._query()) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + body = self._deserialize.dependencies["object"](pipeline_response.http_response.text()) + return [self._deserialize("AIManager", item) for item in (body or {}).get("value", [])] + + +class AIManagerNamespacesOperations: + """Operations for Microsoft.ContainerService/aiManagers/namespaces.""" + + _BASE = ("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" + "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces") + + def __init__(self, client, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + def _url(self, template, **kwargs): + path_args = {k: self._serialize.url(k, v, "str") for k, v in kwargs.items()} + return self._client.format_url(template, **path_args) + + def _query(self): + return {"api-version": self._serialize.query("api_version", API_VERSION, "str")} + + def _headers(self, has_body): + headers = {"Accept": "application/json"} + if has_body: + headers["Content-Type"] = "application/json" + return headers + + def begin_create_or_update(self, resource_group_name, ai_manager_name, namespace_name, + parameters, **kwargs): + url = self._url( + self._BASE + "/{namespaceName}", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + namespaceName=namespace_name, + ) + body = self._serialize.body(parameters, "AIManagerNamespace") + request = HttpRequest("PUT", url, headers=self._headers(True)) + request.format_parameters(self._query()) + request.set_json_body(body) + + def deserialization_callback(pipeline_response): + return self._deserialize("AIManagerNamespace", pipeline_response.http_response) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + return LROPoller( + self._client, pipeline_response, deserialization_callback, ARMPolling(30, **kwargs) + ) + + def get(self, resource_group_name, ai_manager_name, namespace_name, **kwargs): + url = self._url( + self._BASE + "/{namespaceName}", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + namespaceName=namespace_name, + ) + request = HttpRequest("GET", url, headers=self._headers(False)) + request.format_parameters(self._query()) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + return self._deserialize("AIManagerNamespace", pipeline_response.http_response) + + def begin_delete(self, resource_group_name, ai_manager_name, namespace_name, **kwargs): + url = self._url( + self._BASE + "/{namespaceName}", + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + namespaceName=namespace_name, + ) + request = HttpRequest("DELETE", url, headers=self._headers(False)) + request.format_parameters(self._query()) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + return LROPoller(self._client, pipeline_response, lambda _: None, ARMPolling(30, **kwargs)) + + def list_by_ai_manager(self, resource_group_name, ai_manager_name, **kwargs): + url = self._url( + self._BASE, + subscriptionId=self._client._subscription_id, + resourceGroupName=resource_group_name, + aiManagerName=ai_manager_name, + ) + request = HttpRequest("GET", url, headers=self._headers(False)) + request.format_parameters(self._query()) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + body = self._deserialize.dependencies["object"](pipeline_response.http_response.text()) + return [self._deserialize("AIManagerNamespace", item) + for item in (body or {}).get("value", [])] + + +class AIManagerMgmtClient: + """Illustrative management client (what AutoRest calls e.g. ContainerServiceAIManagerClient).""" + + def __init__(self, credential, subscription_id, base_url, credential_scopes=None, **kwargs): + self._subscription_id = subscription_id + policies = kwargs.pop("policies", None) + if policies is None: + policies = [ARMAutoResourceProviderRegistrationPolicy()] + self._pipeline_client = ARMPipelineClient( + base_url=base_url, + credential=credential, + credential_scopes=credential_scopes or [base_url.rstrip("/") + "/.default"], + per_call_policies=policies, + **kwargs, + ) + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + self.ai_managers = AIManagersOperations(self, self._serialize, self._deserialize) + self.ai_manager_namespaces = AIManagerNamespacesOperations( + self, self._serialize, self._deserialize) + + # convenience shims so operations can use `self._client.<...>` + @property + def _pipeline(self): + return self._pipeline_client._pipeline + + def format_url(self, template, **kwargs): + return self._pipeline_client.format_url(template, **kwargs) diff --git a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py new file mode 100644 index 00000000000..76e757138ed --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py @@ -0,0 +1,94 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Illustrative track2-style models for the AIManager resource. + +In a real extension these would be generated by AutoRest from the Swagger and +placed under ``vendored_sdks/``. They are hand-written here, condensed, only to +demonstrate the classic (non-AAZ) command pattern. +""" + +from msrest.serialization import Model + + +class ManagedServiceIdentity(Model): + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + } + + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs): + super().__init__(**kwargs) + self.type = type + self.user_assigned_identities = user_assigned_identities + self.principal_id = None + self.tenant_id = None + + +class AIManagerProperties(Model): + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "delete_policy": {"key": "deletePolicy", "type": "str"}, + "managed_resource_group_name": {"key": "managedResourceGroupName", "type": "str"}, + } + + def __init__(self, *, delete_policy=None, **kwargs): + super().__init__(**kwargs) + self.provisioning_state = None + self.delete_policy = delete_policy + self.managed_resource_group_name = None + + +class AIManager(Model): + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "properties": {"key": "properties", "type": "AIManagerProperties"}, + } + + def __init__(self, *, location=None, tags=None, identity=None, properties=None, **kwargs): + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.identity = identity + self.properties = properties + + +class AIManagerNamespaceProperties(Model): + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "labels": {"key": "labels", "type": "{str}"}, + "annotations": {"key": "annotations", "type": "{str}"}, + } + + def __init__(self, *, labels=None, annotations=None, **kwargs): + super().__init__(**kwargs) + self.provisioning_state = None + self.labels = labels + self.annotations = annotations + + +class AIManagerNamespace(Model): + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "AIManagerNamespaceProperties"}, + } + + def __init__(self, *, properties=None, **kwargs): + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties diff --git a/src/aks-preview/azext_aks_preview/commands.py b/src/aks-preview/azext_aks_preview/commands.py index 647fb4deaa6..b07b3b15df0 100644 --- a/src/aks-preview/azext_aks_preview/commands.py +++ b/src/aks-preview/azext_aks_preview/commands.py @@ -628,3 +628,7 @@ def load_command_table(self, _): self.command_table["aks safeguards delete"] = Delete(loader=self) self.command_table["aks safeguards list"] = List(loader=self) self.command_table["aks safeguards wait"] = Wait(loader=self) + + # AKS inference (AI Manager) commands - classic vendored-SDK approach + from .aks_inference.commands import load_command_table as _load_aks_inference_commands + _load_aks_inference_commands(self, _) From 0e1c969a2d56b2f6a500136652347e7e9e712427 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Wed, 5 Aug 2026 20:45:04 +0000 Subject: [PATCH 03/11] Switch az aimanager to real vendored containerserviceaimanager SDK Rename the aks_inference command group/folder to aimanager and replace the hand-written stub SDK with the generated azure-mgmt-containerserviceaimanager package under aimanager/vendored_sdk. Commands: az aimanager create|update|list|show|delete and az aimanager namespace add|update|list|show|delete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/aks-preview/HISTORY.rst | 1 + src/aks-preview/azext_aks_preview/_help.py | 4 +- src/aks-preview/azext_aks_preview/_params.py | 6 +- .../{aks_inference => aimanager}/__init__.py | 0 .../aimanager/_client_factory.py | 26 + .../azext_aks_preview/aimanager/_help.py | 107 + .../{aks_inference => aimanager}/_params.py | 21 +- .../azext_aks_preview/aimanager/commands.py | 44 + .../azext_aks_preview/aimanager/custom.py | 96 + .../aimanager/vendored_sdk/__init__.py | 32 + .../aimanager/vendored_sdk/_client.py | 168 + .../aimanager/vendored_sdk/_configuration.py | 82 + .../aimanager/vendored_sdk/_patch.py | 21 + .../vendored_sdk/_utils}/__init__.py | 11 +- .../vendored_sdk/_utils/model_base.py | 1805 ++++++ .../vendored_sdk/_utils/serialization.py | 2179 ++++++++ .../aimanager/vendored_sdk/_utils/utils.py | 40 + .../aimanager/vendored_sdk/_validation.py | 66 + .../aimanager/vendored_sdk/_version.py | 9 + .../aimanager/vendored_sdk/aio/__init__.py | 29 + .../aimanager/vendored_sdk/aio/_client.py | 173 + .../vendored_sdk/aio/_configuration.py | 82 + .../aimanager/vendored_sdk/aio/_patch.py | 21 + .../vendored_sdk/aio/operations/__init__.py | 35 + .../aio/operations/_operations.py | 4036 ++++++++++++++ .../vendored_sdk/aio/operations/_patch.py | 21 + .../aimanager/vendored_sdk/models/__init__.py | 128 + .../aimanager/vendored_sdk/models/_enums.py | 162 + .../aimanager/vendored_sdk/models/_models.py | 1453 +++++ .../aimanager/vendored_sdk/models/_patch.py | 21 + .../vendored_sdk/operations/__init__.py | 35 + .../vendored_sdk/operations/_operations.py | 4850 +++++++++++++++++ .../vendored_sdk/operations/_patch.py | 21 + .../aimanager/vendored_sdk/py.typed | 1 + .../aimanager/vendored_sdk/types.py | 625 +++ .../aks_inference/_client_factory.py | 22 - .../azext_aks_preview/aks_inference/_help.py | 93 - .../aks_inference/commands.py | 44 - .../azext_aks_preview/aks_inference/custom.py | 77 - .../aks_inference/vendored_sdk/_client.py | 233 - .../aks_inference/vendored_sdk/models.py | 94 - src/aks-preview/azext_aks_preview/commands.py | 6 +- 42 files changed, 16394 insertions(+), 586 deletions(-) rename src/aks-preview/azext_aks_preview/{aks_inference => aimanager}/__init__.py (100%) create mode 100644 src/aks-preview/azext_aks_preview/aimanager/_client_factory.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/_help.py rename src/aks-preview/azext_aks_preview/{aks_inference => aimanager}/_params.py (64%) create mode 100644 src/aks-preview/azext_aks_preview/aimanager/commands.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/custom.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_client.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_configuration.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_patch.py rename src/aks-preview/azext_aks_preview/{aks_inference/vendored_sdk => aimanager/vendored_sdk/_utils}/__init__.py (62%) create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/model_base.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/serialization.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/utils.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_validation.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_version.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_client.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_configuration.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_patch.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_operations.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_patch.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_enums.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_models.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_patch.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/__init__.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_operations.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_patch.py create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/py.typed create mode 100644 src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/types.py delete mode 100644 src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py delete mode 100644 src/aks-preview/azext_aks_preview/aks_inference/_help.py delete mode 100644 src/aks-preview/azext_aks_preview/aks_inference/commands.py delete mode 100644 src/aks-preview/azext_aks_preview/aks_inference/custom.py delete mode 100644 src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py delete mode 100644 src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index e2b97761e0f..2b9bf5cf148 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -11,6 +11,7 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ +* `az aimanager`: Add `create`, `update`, `list`, `show`, `delete` and `namespace add/update/list/show/delete` commands for AI Manager, backed by the vendored `azure-mgmt-containerserviceaimanager` SDK. * Fix `match_condition` kwarg leaking to HTTP transport by overriding `put_mc` and `add_agentpool` to pass `if_match` / `if_none_match` directly to the vendored SDK. This change fixes the compatibility issue as azure-cli/acs module adopts TypeSpec emitted SDKs while azure-cli-extensions/aks-preview still uses the autorest emitted SDK. + `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region. * `az aks create/update`: Add `--enable-service-account-image-pull`, `--disable-service-account-image-pull`, and `--service-account-image-pull-default-managed-identity-id` parameters to manage service account based image pull settings. diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index c3eaedf4dcf..813cfa53499 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -4554,5 +4554,5 @@ text: az aks jwtauthenticator show -g MyResourceGroup --cluster-name MyCluster --name myjwt """ -# AKS inference (AI Manager) command help - classic vendored-SDK approach -from .aks_inference import _help # noqa: F401,E402 +# AI Manager (az aimanager) command help - vendored-SDK approach +from .aimanager import _help # noqa: F401,E402 diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index 60a4e52319e..1a700ca842d 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -3247,9 +3247,9 @@ def load_arguments(self, _): help="Show all VM SKU information including those not available for the current subscription.", ) - # AKS inference (AI Manager) commands - classic vendored-SDK approach - from .aks_inference._params import load_arguments as _load_aks_inference_arguments - _load_aks_inference_arguments(self, _) + # AI Manager (az aimanager) commands - vendored-SDK approach + from .aimanager._params import load_arguments as _load_aimanager_arguments + _load_aimanager_arguments(self, _) def _get_default_install_location(exe_name): diff --git a/src/aks-preview/azext_aks_preview/aks_inference/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aks_inference/__init__.py rename to src/aks-preview/azext_aks_preview/aimanager/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py b/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py new file mode 100644 index 00000000000..abb4490b72d --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Client factory for the AI Manager commands. + +Wires up the vendored ``azure-mgmt-containerserviceaimanager`` track2 client through +``get_mgmt_service_client`` (credential, subscription id, ARM endpoint and scopes) and +exposes the individual operation groups used by the custom commands. +""" + +from azure.cli.core.commands.client_factory import get_mgmt_service_client + +from .vendored_sdk import ContainerServiceAIManagerMgmtClient + + +def cf_aimanager_client(cli_ctx, *_): + return get_mgmt_service_client(cli_ctx, ContainerServiceAIManagerMgmtClient) + + +def cf_ai_managers(cli_ctx, *_): + return cf_aimanager_client(cli_ctx).ai_managers + + +def cf_ai_manager_namespaces(cli_ctx, *_): + return cf_aimanager_client(cli_ctx).ai_manager_namespaces diff --git a/src/aks-preview/azext_aks_preview/aimanager/_help.py b/src/aks-preview/azext_aks_preview/aimanager/_help.py new file mode 100644 index 00000000000..b084f3247d2 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/_help.py @@ -0,0 +1,107 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Help definitions for the ``az aimanager`` command group. + +Import this module once (from the extension's ``_help.py``) so the strings get registered. +""" + +from knack.help_files import helps + + +helps['aimanager'] = """ + type: group + short-summary: Manage AI Manager resources for inference on AKS. +""" + +helps['aimanager create'] = """ + type: command + short-summary: Create an AI Manager resource. + examples: + - name: Create an AI Manager + text: az aimanager create --name my-ai-manager -g myrg -l eastus2 + - name: Create an AI Manager with the Keep delete policy + text: az aimanager create --name my-ai-manager -g myrg -l eastus2 --delete-policy Keep +""" + +helps['aimanager update'] = """ + type: command + short-summary: Update an AI Manager resource. + examples: + - name: Update the tags of an AI Manager + text: az aimanager update --name my-ai-manager -g myrg --tags env=prod team=alpha +""" + +helps['aimanager show'] = """ + type: command + short-summary: Show the details of an AI Manager resource. + examples: + - name: Show an AI Manager + text: az aimanager show --name my-ai-manager -g myrg +""" + +helps['aimanager delete'] = """ + type: command + short-summary: Delete an AI Manager resource. + examples: + - name: Delete an AI Manager + text: az aimanager delete --name my-ai-manager -g myrg +""" + +helps['aimanager list'] = """ + type: command + short-summary: List AI Manager resources. + examples: + - name: List AI Managers in a resource group + text: az aimanager list -g myrg + - name: List all AI Managers in the subscription + text: az aimanager list +""" + +helps['aimanager namespace'] = """ + type: group + short-summary: Manage namespaces within an AI Manager. +""" + +helps['aimanager namespace add'] = """ + type: command + short-summary: Add a namespace to an AI Manager. + examples: + - name: Add a namespace + text: az aimanager namespace add -m my-ai-manager -g myrg --name team-alpha + - name: Add a namespace with labels and annotations + text: az aimanager namespace add -m my-ai-manager -g myrg --name team-alpha --labels team=alpha --annotations owner=alice +""" + +helps['aimanager namespace update'] = """ + type: command + short-summary: Update a namespace within an AI Manager. + examples: + - name: Update the labels of a namespace + text: az aimanager namespace update -m my-ai-manager -g myrg --name team-alpha --labels team=beta +""" + +helps['aimanager namespace show'] = """ + type: command + short-summary: Show the details of a namespace within an AI Manager. + examples: + - name: Show a namespace + text: az aimanager namespace show -m my-ai-manager -g myrg --name team-alpha +""" + +helps['aimanager namespace delete'] = """ + type: command + short-summary: Delete a namespace within an AI Manager. + examples: + - name: Delete a namespace + text: az aimanager namespace delete -m my-ai-manager -g myrg --name team-alpha +""" + +helps['aimanager namespace list'] = """ + type: command + short-summary: List the namespaces within an AI Manager. + examples: + - name: List namespaces in an AI Manager + text: az aimanager namespace list -m my-ai-manager -g myrg +""" diff --git a/src/aks-preview/azext_aks_preview/aks_inference/_params.py b/src/aks-preview/azext_aks_preview/aimanager/_params.py similarity index 64% rename from src/aks-preview/azext_aks_preview/aks_inference/_params.py rename to src/aks-preview/azext_aks_preview/aimanager/_params.py index 388b8bc42ef..3444da3595b 100644 --- a/src/aks-preview/azext_aks_preview/aks_inference/_params.py +++ b/src/aks-preview/azext_aks_preview/aimanager/_params.py @@ -2,33 +2,38 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -"""Argument definitions — the classic equivalent of `_params.py` load_arguments.""" +"""Argument definitions for the ``az aimanager`` command group.""" from azure.cli.core.commands.parameters import ( get_location_type, tags_type, get_enum_type, get_resource_name_completion_list) def load_arguments(self, _): - with self.argument_context('aks inference') as c: + with self.argument_context('aimanager') as c: c.argument('ai_manager_name', options_list=['--name', '-n'], help='The name of the AI Manager resource.', completer=get_resource_name_completion_list('Microsoft.ContainerService/aiManagers')) - with self.argument_context('aks inference create') as c: + with self.argument_context('aimanager create') as c: c.argument('location', arg_type=get_location_type(self.cli_ctx)) c.argument('tags', arg_type=tags_type) c.argument('delete_policy', arg_type=get_enum_type(['Keep', 'Delete']), help="Delete options of the AI Manager. Defaults to Delete.") - with self.argument_context('aks inference list') as c: + with self.argument_context('aimanager update') as c: + c.argument('tags', arg_type=tags_type) + + with self.argument_context('aimanager list') as c: c.ignore('ai_manager_name') - with self.argument_context('aks inference namespace') as c: + with self.argument_context('aimanager namespace') as c: c.argument('ai_manager_name', options_list=['--manager', '-m'], help='The name of the AI Manager resource.') c.argument('namespace_name', options_list=['--name', '-n'], help='The name of the AI Manager namespace.') - with self.argument_context('aks inference namespace create') as c: - c.argument('labels', tags_type, help='Labels applied to the Kubernetes namespace.') - c.argument('annotations', tags_type, help='Annotations applied to the Kubernetes namespace.') + for scope in ['aimanager namespace add', 'aimanager namespace update']: + with self.argument_context(scope) as c: + c.argument('labels', tags_type, help='Labels applied to the Kubernetes namespace.') + c.argument('annotations', tags_type, + help='Annotations applied to the Kubernetes namespace.') diff --git a/src/aks-preview/azext_aks_preview/aimanager/commands.py b/src/aks-preview/azext_aks_preview/aimanager/commands.py new file mode 100644 index 00000000000..aa9f5b3eb56 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/commands.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Command registration for the ``az aimanager`` command group. + +This module is not auto-loaded; ``load_command_table`` is invoked from the extension's +top-level ``commands.py``. +""" + +from azure.cli.core.commands import CliCommandType + +from ._client_factory import cf_ai_managers, cf_ai_manager_namespaces + + +def load_command_table(self, _): + aimanager_custom = CliCommandType( + operations_tmpl='azext_aks_preview.aimanager.custom#{}', + client_factory=cf_ai_managers, + ) + + with self.command_group('aimanager', aimanager_custom, + custom_command_type=aimanager_custom, + client_factory=cf_ai_managers, is_preview=True) as g: + g.custom_command('create', 'aimanager_create', supports_no_wait=True) + g.custom_command('update', 'aimanager_update') + g.custom_show_command('show', 'aimanager_show') + g.custom_command('delete', 'aimanager_delete', supports_no_wait=True, confirmation=True) + g.custom_command('list', 'aimanager_list') + + namespace_custom = CliCommandType( + operations_tmpl='azext_aks_preview.aimanager.custom#{}', + client_factory=cf_ai_manager_namespaces, + ) + + with self.command_group('aimanager namespace', namespace_custom, + custom_command_type=namespace_custom, + client_factory=cf_ai_manager_namespaces, is_preview=True) as g: + g.custom_command('add', 'aimanager_namespace_add', supports_no_wait=True) + g.custom_command('update', 'aimanager_namespace_update', supports_no_wait=True) + g.custom_show_command('show', 'aimanager_namespace_show') + g.custom_command('delete', 'aimanager_namespace_delete', + supports_no_wait=True, confirmation=True) + g.custom_command('list', 'aimanager_namespace_list') diff --git a/src/aks-preview/azext_aks_preview/aimanager/custom.py b/src/aks-preview/azext_aks_preview/aimanager/custom.py new file mode 100644 index 00000000000..19caa39a1d9 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/custom.py @@ -0,0 +1,96 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Custom command implementations for the AI Manager commands. + +These build the vendored SDK models, call the operation-group methods and return the +result (or the poller when ``--no-wait`` is passed). +""" + +from azure.cli.core.commands import LongRunningOperation + +from .vendored_sdk import models + + +def _wait(cmd, poller, no_wait): + if no_wait: + return poller + return LongRunningOperation(cmd.cli_ctx)(poller) + + +# region AI Manager + +def aimanager_create(cmd, client, resource_group_name, ai_manager_name, location=None, + tags=None, delete_policy=None, no_wait=False): + resource = models.AIManager( + location=location, + tags=tags, + properties=models.AIManagerProperties(delete_policy=delete_policy), + ) + poller = client.begin_create_or_update(resource_group_name, ai_manager_name, resource) + return _wait(cmd, poller, no_wait) + + +def aimanager_update(cmd, client, resource_group_name, ai_manager_name, tags=None): + properties = models.AIManagerPatch(tags=tags) + return client.update(resource_group_name, ai_manager_name, properties) + + +def aimanager_show(cmd, client, resource_group_name, ai_manager_name): + return client.get(resource_group_name, ai_manager_name) + + +def aimanager_delete(cmd, client, resource_group_name, ai_manager_name, no_wait=False): + poller = client.begin_delete(resource_group_name, ai_manager_name) + return _wait(cmd, poller, no_wait) + + +def aimanager_list(cmd, client, resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list_by_subscription() + +# endregion + + +# region AI Manager namespace + +def aimanager_namespace_add(cmd, client, resource_group_name, ai_manager_name, namespace_name, + labels=None, annotations=None, no_wait=False): + resource = models.AIManagerNamespace( + properties=models.AIManagerNamespaceProperties(labels=labels, annotations=annotations), + ) + poller = client.begin_create_or_update( + resource_group_name, ai_manager_name, namespace_name, resource) + return _wait(cmd, poller, no_wait) + + +def aimanager_namespace_update(cmd, client, resource_group_name, ai_manager_name, namespace_name, + labels=None, annotations=None, no_wait=False): + existing = client.get(resource_group_name, ai_manager_name, namespace_name) + properties = existing.properties or models.AIManagerNamespaceProperties() + if labels is not None: + properties.labels = labels + if annotations is not None: + properties.annotations = annotations + resource = models.AIManagerNamespace(properties=properties) + poller = client.begin_create_or_update( + resource_group_name, ai_manager_name, namespace_name, resource) + return _wait(cmd, poller, no_wait) + + +def aimanager_namespace_show(cmd, client, resource_group_name, ai_manager_name, namespace_name): + return client.get(resource_group_name, ai_manager_name, namespace_name) + + +def aimanager_namespace_delete(cmd, client, resource_group_name, ai_manager_name, + namespace_name, no_wait=False): + poller = client.begin_delete(resource_group_name, ai_manager_name, namespace_name) + return _wait(cmd, poller, no_wait) + + +def aimanager_namespace_list(cmd, client, resource_group_name, ai_manager_name): + return client.list_by_ai_manager(resource_group_name, ai_manager_name) + +# endregion diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/__init__.py new file mode 100644 index 00000000000..d29c554dcee --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ContainerServiceAIManagerMgmtClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceAIManagerMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_client.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_client.py new file mode 100644 index 00000000000..5a59b02759a --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_client.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from ._configuration import ContainerServiceAIManagerMgmtClientConfiguration +from ._utils.serialization import Deserializer, Serializer +from .operations import ( + AIManagerNamespacesOperations, + AIManagersOperations, + AIModelsOperations, + ModelDeploymentsOperations, + ModelSourcesOperations, + Operations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class ContainerServiceAIManagerMgmtClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure Kubernetes AI Manager api client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerserviceaimanager.operations.Operations + :ivar ai_managers: AIManagersOperations operations + :vartype ai_managers: azure.mgmt.containerserviceaimanager.operations.AIManagersOperations + :ivar ai_manager_namespaces: AIManagerNamespacesOperations operations + :vartype ai_manager_namespaces: + azure.mgmt.containerserviceaimanager.operations.AIManagerNamespacesOperations + :ivar ai_models: AIModelsOperations operations + :vartype ai_models: azure.mgmt.containerserviceaimanager.operations.AIModelsOperations + :ivar model_sources: ModelSourcesOperations operations + :vartype model_sources: azure.mgmt.containerserviceaimanager.operations.ModelSourcesOperations + :ivar model_deployments: ModelDeploymentsOperations operations + :vartype model_deployments: + azure.mgmt.containerserviceaimanager.operations.ModelDeploymentsOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-05-02-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ContainerServiceAIManagerMgmtClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.ai_managers = AIManagersOperations(self._client, self._config, self._serialize, self._deserialize) + self.ai_manager_namespaces = AIManagerNamespacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.ai_models = AIModelsOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_sources = ModelSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_deployments = ModelDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_configuration.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_configuration.py new file mode 100644 index 00000000000..70d345afae4 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_configuration.py @@ -0,0 +1,82 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials import TokenCredential + + +class ContainerServiceAIManagerMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only + """Configuration for ContainerServiceAIManagerMgmtClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-05-02-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2026-05-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerserviceaimanager/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_patch.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_patch.py new file mode 100644 index 00000000000..87676c65a8f --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/__init__.py similarity index 62% rename from src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/__init__.py rename to src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/__init__.py index 41f3467c052..8026245c2ab 100644 --- a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/__init__.py +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/__init__.py @@ -1,9 +1,6 @@ -# -------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from ._client import AIManagerMgmtClient -from . import models - -__all__ = ["AIManagerMgmtClient", "models"] +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/model_base.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/model_base.py new file mode 100644 index 00000000000..88aaf182354 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/model_base.py @@ -0,0 +1,1805 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on the mapping's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on the mapping's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: a set-like object providing a view on the mapping's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if the dictionary is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from the dictionary. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Update the dictionary from a mapping or an iterable of key-value pairs. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + dict_to_pass.update(self._init_from_xml(args[0])) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) + super().__init__(dict_to_pass) + + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + original_tsp_name: typing.Optional[str] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + self._original_tsp_name = original_tsp_name + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, + original_tsp_name: typing.Optional[str] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + original_tsp_name=original_tsp_name, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) + wrapped_element = _create_xml_element( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _set_xml_attribute(wrapped_element, k, v, prop_meta) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/serialization.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/serialization.py new file mode 100644 index 00000000000..ae08f9d89f7 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/serialization.py @@ -0,0 +1,2179 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + MutableMapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + +TZ_UTC = datetime.timezone.utc + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises DeserializationError: if something went wrong + :rtype: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer: # pylint: disable=too-many-public-methods + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises SerializationError: if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized |= target_obj.additional_properties + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises TypeError: if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises SerializationError: if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises SerializationError: if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(list[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer: + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties # type: ignore + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises DeserializationError: if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises TypeError: if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises TypeError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises ValueError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises DeserializationError: if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises DeserializationError: if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/utils.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/utils.py new file mode 100644 index 00000000000..cbaa624660e --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/utils.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core import MatchConditions + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_validation.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_validation.py new file mode 100644 index 00000000000..f5af3a4eb8a --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_version.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_version.py new file mode 100644 index 00000000000..be71c81bd28 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/__init__.py new file mode 100644 index 00000000000..2acdba6d228 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/__init__.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ContainerServiceAIManagerMgmtClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceAIManagerMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_client.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_client.py new file mode 100644 index 00000000000..0630088268d --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_client.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints + +from .._utils.serialization import Deserializer, Serializer +from ._configuration import ContainerServiceAIManagerMgmtClientConfiguration +from .operations import ( + AIManagerNamespacesOperations, + AIManagersOperations, + AIModelsOperations, + ModelDeploymentsOperations, + ModelSourcesOperations, + Operations, +) + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceAIManagerMgmtClient: # pylint: disable=docstring-keyword-should-match-keyword-only + """Azure Kubernetes AI Manager api client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerserviceaimanager.aio.operations.Operations + :ivar ai_managers: AIManagersOperations operations + :vartype ai_managers: azure.mgmt.containerserviceaimanager.aio.operations.AIManagersOperations + :ivar ai_manager_namespaces: AIManagerNamespacesOperations operations + :vartype ai_manager_namespaces: + azure.mgmt.containerserviceaimanager.aio.operations.AIManagerNamespacesOperations + :ivar ai_models: AIModelsOperations operations + :vartype ai_models: azure.mgmt.containerserviceaimanager.aio.operations.AIModelsOperations + :ivar model_sources: ModelSourcesOperations operations + :vartype model_sources: + azure.mgmt.containerserviceaimanager.aio.operations.ModelSourcesOperations + :ivar model_deployments: ModelDeploymentsOperations operations + :vartype model_deployments: + azure.mgmt.containerserviceaimanager.aio.operations.ModelDeploymentsOperations + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is None. + :type base_url: str + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-05-02-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) + self._config = ContainerServiceAIManagerMgmtClientConfiguration( + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs + ) + + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.ai_managers = AIManagersOperations(self._client, self._config, self._serialize, self._deserialize) + self.ai_manager_namespaces = AIManagerNamespacesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.ai_models = AIModelsOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_sources = ModelSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.model_deployments = ModelDeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_configuration.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_configuration.py new file mode 100644 index 00000000000..a359270e667 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_configuration.py @@ -0,0 +1,82 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + from azure.core import AzureClouds + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceAIManagerMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only + """Configuration for ContainerServiceAIManagerMgmtClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are + "2026-05-02-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2026-05-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerserviceaimanager/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_patch.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_patch.py new file mode 100644 index 00000000000..87676c65a8f --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/__init__.py new file mode 100644 index 00000000000..f15411ea000 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/__init__.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AIManagersOperations # type: ignore +from ._operations import AIManagerNamespacesOperations # type: ignore +from ._operations import AIModelsOperations # type: ignore +from ._operations import ModelSourcesOperations # type: ignore +from ._operations import ModelDeploymentsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "AIManagersOperations", + "AIManagerNamespacesOperations", + "AIModelsOperations", + "ModelSourcesOperations", + "ModelDeploymentsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_operations.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_operations.py new file mode 100644 index 00000000000..58603fd6935 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_operations.py @@ -0,0 +1,4036 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import AsyncPipelineClient, MatchConditions +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceModifiedError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation +from ...operations._operations import ( + build_ai_manager_namespaces_create_or_update_request, + build_ai_manager_namespaces_delete_request, + build_ai_manager_namespaces_get_request, + build_ai_manager_namespaces_list_access_keys_request, + build_ai_manager_namespaces_list_by_ai_manager_request, + build_ai_manager_namespaces_list_credential_request, + build_ai_manager_namespaces_rotate_keys_request, + build_ai_managers_create_or_update_request, + build_ai_managers_delete_request, + build_ai_managers_get_request, + build_ai_managers_list_by_resource_group_request, + build_ai_managers_list_by_subscription_request, + build_ai_managers_list_credential_request, + build_ai_managers_update_request, + build_ai_models_calculate_cost_request, + build_ai_models_get_request, + build_ai_models_list_request, + build_model_deployments_create_or_update_request, + build_model_deployments_delete_request, + build_model_deployments_get_request, + build_model_deployments_list_by_ai_manager_namespace_request, + build_model_sources_create_or_update_request, + build_model_sources_delete_request, + build_model_sources_get_request, + build_model_sources_list_request, + build_operations_list_request, +) +from .._configuration import ContainerServiceAIManagerMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.aio.ContainerServiceAIManagerMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class AIManagersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.aio.ContainerServiceAIManagerMgmtClient`'s + :attr:`ai_managers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, ai_manager_name: str, **kwargs: Any) -> _models.AIManager: + """Get a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AIManager] = kwargs.pop("cls", None) + + _request = build_ai_managers_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIManager, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + resource: Union[_models.AIManager, _types.AIManager, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_managers_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: _models.AIManager, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManager + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: _types.AIManager, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.AIManager + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: Union[_models.AIManager, _types.AIManager, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Is either a AIManager type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManager or + ~azure.mgmt.containerserviceaimanager.types.AIManager or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AIManager] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AIManager, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AIManager].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AIManager]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: _models.AIManagerPatch, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.containerserviceaimanager.models.AIManagerPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: _types.AIManagerPatch, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.containerserviceaimanager.types.AIManagerPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: Union[_models.AIManagerPatch, _types.AIManagerPatch, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Is either a AIManagerPatch type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.containerserviceaimanager.models.AIManagerPatch or + ~azure.mgmt.containerserviceaimanager.types.AIManagerPatch or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AIManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_managers_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIManager, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ai_managers_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.AIManager"]: + """List AIManager resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AIManager + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIManager]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_managers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIManager], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.AIManager"]: + """List AIManager resources by subscription ID. + + :return: An iterator like instance of AIManager + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIManager]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_managers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIManager], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_credential( + self, resource_group_name: str, ai_manager_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of an AI Manager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_ai_managers_list_credential_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AIManagerNamespacesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.aio.ContainerServiceAIManagerMgmtClient`'s + :attr:`ai_manager_namespaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.AIManagerNamespace: + """Get a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: AIManagerNamespace. The AIManagerNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AIManagerNamespace] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIManagerNamespace, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: Union[_models.AIManagerNamespace, _types.AIManagerNamespace, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_manager_namespaces_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: _models.AIManagerNamespace, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManagerNamespace. The AIManagerNamespace + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: _types.AIManagerNamespace, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.AIManagerNamespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManagerNamespace. The AIManagerNamespace + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManagerNamespace. The AIManagerNamespace + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: Union[_models.AIManagerNamespace, _types.AIManagerNamespace, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Is either a AIManagerNamespace type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace or + ~azure.mgmt.containerserviceaimanager.types.AIManagerNamespace or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AIManagerNamespace. The AIManagerNamespace + is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AIManagerNamespace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AIManagerNamespace, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AIManagerNamespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AIManagerNamespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_ai_manager( + self, resource_group_name: str, ai_manager_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.AIManagerNamespace"]: + """List AIManagerNamespace resources by AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: An iterator like instance of AIManagerNamespace + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIManagerNamespace]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_manager_namespaces_list_by_ai_manager_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIManagerNamespace], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_credential( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of an AI Manager namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_list_credential_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def list_access_keys( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.NamespaceAccessInfo: + """Returns the namespace-scoped LLM gateway endpoint and the current API keys. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: NamespaceAccessInfo. The NamespaceAccessInfo is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.NamespaceAccessInfo + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceAccessInfo] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_list_access_keys_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceAccessInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def rotate_keys( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.NamespaceAccessInfo: + """Rotates the namespace-scoped LLM gateway API keys. A new key is generated and installed as + ``primaryKey``, and the previous ``primaryKey`` overwrites ``secondaryKey`` so clients can roll + over without downtime. Returns the updated access info. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: NamespaceAccessInfo. The NamespaceAccessInfo is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.NamespaceAccessInfo + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceAccessInfo] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_rotate_keys_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceAccessInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AIModelsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.aio.ContainerServiceAIManagerMgmtClient`'s + :attr:`ai_models` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": ["api_version", "subscription_id", "location", "ai_model_name", "accept"] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def get(self, location: str, ai_model_name: str, **kwargs: Any) -> _models.AIModel: + """Get a AIModel. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :return: AIModel. The AIModel is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AIModel] = kwargs.pop("cls", None) + + _request = build_ai_models_get_request( + location=location, + ai_model_name=ai_model_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={"2026-05-02-preview": ["api_version", "subscription_id", "location", "accept"]}, + api_versions_list=["2026-05-02-preview"], + ) + def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.AIModel"]: + """List AIModel resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AIModel + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.AIModel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIModel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_models_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIModel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def calculate_cost( + self, + location: str, + ai_model_name: str, + body: _models.CalculateCostRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.containerserviceaimanager.models.CalculateCostRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def calculate_cost( + self, + location: str, + ai_model_name: str, + body: _types.CalculateCostRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.containerserviceaimanager.types.CalculateCostRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def calculate_cost( + self, + location: str, + ai_model_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "location", + "ai_model_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def calculate_cost( + self, + location: str, + ai_model_name: str, + body: Union[_models.CalculateCostRequest, _types.CalculateCostRequest, IO[bytes]], + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Is either a CalculateCostRequest type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.containerserviceaimanager.models.CalculateCostRequest or + ~azure.mgmt.containerserviceaimanager.types.CalculateCostRequest or IO[bytes] + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CalculateCostResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_models_calculate_cost_request( + location=location, + ai_model_name=ai_model_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CalculateCostResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ModelSourcesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.aio.ContainerServiceAIManagerMgmtClient`'s + :attr:`model_sources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def get( + self, resource_group_name: str, ai_manager_name: str, model_source_name: str, **kwargs: Any + ) -> _models.ModelSource: + """Get a ModelSource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :return: ModelSource. The ModelSource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.ModelSource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ModelSource] = kwargs.pop("cls", None) + + _request = build_model_sources_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ModelSource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: Union[_models.ModelSource, _types.ModelSource, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_sources_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: _models.ModelSource, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelSource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelSource. The ModelSource is compatible + with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: _types.ModelSource, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.ModelSource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelSource. The ModelSource is compatible + with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelSource. The ModelSource is compatible + with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: Union[_models.ModelSource, _types.ModelSource, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Is either a ModelSource type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelSource or + ~azure.mgmt.containerserviceaimanager.types.ModelSource or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelSource. The ModelSource is compatible + with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ModelSource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ModelSource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ModelSource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ModelSource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_model_sources_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a ModelSource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": ["api_version", "subscription_id", "resource_group_name", "ai_manager_name", "accept"] + }, + api_versions_list=["2026-05-02-preview"], + ) + def list( + self, resource_group_name: str, ai_manager_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ModelSource"]: + """List ModelSource resources by AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: An iterator like instance of ModelSource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ModelSource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_model_sources_list_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ModelSource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ModelDeploymentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.aio.ContainerServiceAIManagerMgmtClient`'s + :attr:`model_deployments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def get( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + **kwargs: Any + ) -> _models.ModelDeployment: + """Get a ModelDeployment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :return: ModelDeployment. The ModelDeployment is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.ModelDeployment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ModelDeployment] = kwargs.pop("cls", None) + + _request = build_model_deployments_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ModelDeployment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: Union[_models.ModelDeployment, _types.ModelDeployment, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_deployments_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: _models.ModelDeployment, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelDeployment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: _types.ModelDeployment, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.ModelDeployment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: Union[_models.ModelDeployment, _types.ModelDeployment, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Is either a ModelDeployment type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelDeployment or + ~azure.mgmt.containerserviceaimanager.types.ModelDeployment or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ModelDeployment] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ModelDeployment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ModelDeployment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ModelDeployment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_model_deployments_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + async def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a ModelDeployment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def list_by_ai_manager_namespace( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ModelDeployment"]: + """List ModelDeployment resources by AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: An iterator like instance of ModelDeployment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ModelDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_model_deployments_list_by_ai_manager_namespace_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ModelDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_patch.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_patch.py new file mode 100644 index 00000000000..87676c65a8f --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/__init__.py new file mode 100644 index 00000000000..214a456ad5f --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/__init__.py @@ -0,0 +1,128 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AIManager, + AIManagerNamespace, + AIManagerNamespaceProperties, + AIManagerPatch, + AIManagerProperties, + AIModel, + AIModelProperties, + AutoscaleProfile, + CalculateCostPlan, + CalculateCostRequest, + CalculateCostResponse, + CredentialResult, + CredentialResults, + CredentialValue, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + InfeasibilityReason, + InlineCredential, + ManagedServiceIdentity, + ManualScalingProfile, + ModelDeployment, + ModelDeploymentOverrides, + ModelDeploymentProperties, + ModelDeploymentStatus, + ModelSource, + ModelSourceProperties, + ModelSpec, + NamespaceAccessInfo, + Operation, + OperationDisplay, + ProxyResource, + Resource, + ScalingProfile, + ServingPerformanceEstimation, + SystemData, + TrackedResource, + UserAssignedIdentity, +) + +from ._enums import ( # type: ignore + AIManagerNamespaceProvisioningState, + AIManagerProvisioningState, + ActionType, + CreatedByType, + DeletePolicy, + InfeasibleCode, + ManagedServiceIdentityType, + ModelDeploymentPerformanceMode, + ModelDeploymentProvisioningState, + ModelSourceType, + Origin, + ResourceProvisioningState, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AIManager", + "AIManagerNamespace", + "AIManagerNamespaceProperties", + "AIManagerPatch", + "AIManagerProperties", + "AIModel", + "AIModelProperties", + "AutoscaleProfile", + "CalculateCostPlan", + "CalculateCostRequest", + "CalculateCostResponse", + "CredentialResult", + "CredentialResults", + "CredentialValue", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "InfeasibilityReason", + "InlineCredential", + "ManagedServiceIdentity", + "ManualScalingProfile", + "ModelDeployment", + "ModelDeploymentOverrides", + "ModelDeploymentProperties", + "ModelDeploymentStatus", + "ModelSource", + "ModelSourceProperties", + "ModelSpec", + "NamespaceAccessInfo", + "Operation", + "OperationDisplay", + "ProxyResource", + "Resource", + "ScalingProfile", + "ServingPerformanceEstimation", + "SystemData", + "TrackedResource", + "UserAssignedIdentity", + "AIManagerNamespaceProvisioningState", + "AIManagerProvisioningState", + "ActionType", + "CreatedByType", + "DeletePolicy", + "InfeasibleCode", + "ManagedServiceIdentityType", + "ModelDeploymentPerformanceMode", + "ModelDeploymentProvisioningState", + "ModelSourceType", + "Origin", + "ResourceProvisioningState", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_enums.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_enums.py new file mode 100644 index 00000000000..bdbf22277d6 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_enums.py @@ -0,0 +1,162 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + only APIs. + """ + + INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class AIManagerNamespaceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the AI Manager namespace resource.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + CREATING = "Creating" + """The provisioning state of a namespace being created.""" + UPDATING = "Updating" + """The provisioning state of a namespace being updated.""" + DELETING = "Deleting" + """The provisioning state of a namespace being deleted.""" + + +class AIManagerProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the AI Manager resource.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + CREATING = "Creating" + """Resource is being created.""" + UPDATING = "Updating" + """Resource is updating.""" + DELETING = "Deleting" + """Resource is deleting.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + +class DeletePolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Delete options of the AI Manager.""" + + KEEP = "Keep" + """Keep the underlying cluster resources even if the AIManager resource is deleted.""" + DELETE = "Delete" + """Delete both the underlying cluster resources and the AIManager resource together.""" + + +class InfeasibleCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The reason a ``CalculateCostPlan`` is not deployable.""" + + INSUFFICIENT_QUOTA = "InsufficientQuota" + """The caller's subscription does not have enough GPU quota in the target region to deploy this + plan.""" + REGION_UNAVAILABLE = "RegionUnavailable" + """The VM SKU is not available in the target region.""" + INEFFICIENT_DEPLOYMENT = "InefficientDeployment" + """The deployment can start successfully on this SKU, but its estimated runtime performance falls + below the acceptable threshold for serving this model.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + +class ModelDeploymentPerformanceMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The runtime performance mode of a model deployment.""" + + BALANCED = "Balanced" + """A balanced trade-off between latency and throughput (default).""" + LATENCY = "Latency" + """Optimize for low request latency.""" + THROUGHPUT = "Throughput" + """Optimize for high aggregate throughput.""" + + +class ModelDeploymentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of a model deployment resource.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" + CREATING = "Creating" + """Resource is being created.""" + UPDATING = "Updating" + """Resource is updating.""" + DELETING = "Deleting" + """Resource is deleting.""" + + +class ModelSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a model source.""" + + HUGGING_FACE = "HuggingFace" + """A Hugging Face model registry.""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + """Indicates the operation is initiated by a user.""" + SYSTEM = "system" + """Indicates the operation is initiated by a system.""" + USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" + + +class ResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of a resource type.""" + + SUCCEEDED = "Succeeded" + """Resource has been created.""" + FAILED = "Failed" + """Resource creation failed.""" + CANCELED = "Canceled" + """Resource creation was canceled.""" diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_models.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_models.py new file mode 100644 index 00000000000..41725b89f1c --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_models.py @@ -0,0 +1,1453 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AIManager(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The AI Manager resource. For more information, see `https://aka.ms/aks/aimanager + `_. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.containerserviceaimanager.models.AIManagerProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.containerserviceaimanager.models.ManagedServiceIdentity + """ + + properties: Optional["_models.AIManagerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.AIManagerProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + """ + + +class AIManagerNamespace(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The AI Manager namespace resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespaceProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.AIManagerNamespaceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AIManagerNamespaceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AIManagerNamespaceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AI Manager namespace properties. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespaceProvisioningState + :ivar labels: Labels applied to the Kubernetes namespace. + :vartype labels: dict[str, str] + :ivar annotations: Annotations applied to the Kubernetes namespace. + :vartype annotations: dict[str, str] + """ + + provisioning_state: Optional[Union[str, "_models.AIManagerNamespaceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Creating\", \"Updating\", and \"Deleting\".""" + labels: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Labels applied to the Kubernetes namespace.""" + annotations: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Annotations applied to the Kubernetes namespace.""" + + @overload + def __init__( + self, + *, + labels: Optional[dict[str, str]] = None, + annotations: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AIManagerPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The AI Manager resource patch model. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.containerserviceaimanager.models.ManagedServiceIdentity + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AIManagerProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """AI Manager properties. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.containerserviceaimanager.models.AIManagerProvisioningState + :ivar delete_policy: Delete options of the AI Manager. Defaults to ``Delete`` if not specified. + Known values are: "Keep" and "Delete". + :vartype delete_policy: str or ~azure.mgmt.containerserviceaimanager.models.DeletePolicy + :ivar managed_resource_group_name: The name of the managed resource group created by the AI + Manager to hold underlying infrastructure resources. + :vartype managed_resource_group_name: str + """ + + provisioning_state: Optional[Union[str, "_models.AIManagerProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Creating\", \"Updating\", and \"Deleting\".""" + delete_policy: Optional[Union[str, "_models.DeletePolicy"]] = rest_field( + name="deletePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Delete options of the AI Manager. Defaults to ``Delete`` if not specified. Known values are: + \"Keep\" and \"Delete\".""" + managed_resource_group_name: Optional[str] = rest_field(name="managedResourceGroupName", visibility=["read"]) + """The name of the managed resource group created by the AI Manager to hold underlying + infrastructure resources.""" + + @overload + def __init__( + self, + *, + delete_policy: Optional[Union[str, "_models.DeletePolicy"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AIModel(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """An AI model exposed by Microsoft.ContainerService. Read-only, globally-shared catalog entry + that is platform-maintained and auto-provisioned by the resource provider. Can be referenced by + ``ModelDeployment`` resources. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.containerserviceaimanager.models.AIModelProperties + """ + + properties: Optional["_models.AIModelProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.AIModelProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AIModelProperties(_Model): + """AI model properties. + + :ivar model_id: The Hugging Face model identifier in ``/`` form, e.g. + ``microsoft/Phi-4-mini-instruct``. Uniquely identifies the upstream model that backs this + catalog entry. Required. + :vartype model_id: str + :ivar description: An optional, free-form description of the model. + :vartype description: str + :ivar spec: Specification of the model. Required. + :vartype spec: ~azure.mgmt.containerserviceaimanager.models.ModelSpec + """ + + model_id: str = rest_field(name="modelId", visibility=["read"]) + """The Hugging Face model identifier in ``/`` form, e.g. + ``microsoft/Phi-4-mini-instruct``. Uniquely identifies the upstream model that backs this + catalog entry. Required.""" + description: Optional[str] = rest_field(visibility=["read"]) + """An optional, free-form description of the model.""" + spec: "_models.ModelSpec" = rest_field(visibility=["read"]) + """Specification of the model. Required.""" + + +class AutoscaleProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Autoscaling configuration: scale replica count between a minimum and maximum. + + :ivar min_replicas: The minimum number of replicas. Must be at least ``1``; scale-to-zero is + not supported in autoscale mode (see ``ScalingProfile``). Required. + :vartype min_replicas: int + :ivar max_replicas: The maximum number of replicas. If not specified, the service derives a + default from the subscription GPU quota. + :vartype max_replicas: int + """ + + min_replicas: int = rest_field(name="minReplicas", visibility=["read", "create", "update", "delete", "query"]) + """The minimum number of replicas. Must be at least ``1``; scale-to-zero is not supported in + autoscale mode (see ``ScalingProfile``). Required.""" + max_replicas: Optional[int] = rest_field( + name="maxReplicas", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of replicas. If not specified, the service derives a default from the + subscription GPU quota.""" + + @overload + def __init__( + self, + *, + min_replicas: int, + max_replicas: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CalculateCostPlan(_Model): + """A GPU SKU pricing plan returned by the ``calculateCost`` action. Describes the cost of running + a single model replica on the specified ``vmSize``. To estimate the cost of running multiple + replicas, scale ``totalHourlyPrice`` by the desired replica count, bounded by + ``maxAvailableReplicas``. + + :ivar vm_size: Azure VM SKU, e.g. "Standard_ND96isr_H100_v5". Matches the value accepted by + ``ModelDeploymentProperties.vmSize``. Required. + :vartype vm_size: str + :ivar quantization: Resolved quantization on this SKU. + :vartype quantization: str + :ivar vms_per_replica: Number of VMs required to host one replica on this SKU. Required. + :vartype vms_per_replica: int + :ivar max_available_replicas: Maximum number of replicas the caller's subscription can deploy + on this SKU today, computed from the available GPU quota in the target region. Required. + :vartype max_available_replicas: int + :ivar serving_performance_estimation: Estimated relative inference performance of a single + model replica on this SKU. Omitted when an estimate is unavailable. + :vartype serving_performance_estimation: + ~azure.mgmt.containerserviceaimanager.models.ServingPerformanceEstimation + :ivar vm_hourly_price: On-demand hourly price for a single VM of this SKU, in ``currency``. + Required. + :vartype vm_hourly_price: float + :ivar total_hourly_price: Projected hourly cost for one replica (``vmsPerReplica`` VMs), in + ``currency``. + :vartype total_hourly_price: float + :ivar price_as_of: UTC timestamp of the price snapshot used for this plan. + :vartype price_as_of: ~datetime.datetime + :ivar feasible: Whether the caller can actually deploy this plan today (region availability, + GPU quota, model fit, etc.). This field gates the mutually exclusive properties on this model: + + * When `feasible` is `true`: `totalHourlyPrice` is set and `infeasibilityReason` is + omitted. + * When `feasible` is `false`: `infeasibilityReason` is set and `totalHourlyPrice` is + omitted. Required. + :vartype feasible: bool + :ivar infeasibility_reason: Reason explaining why the plan is not deployable. This is a + per-plan annotation, not an ARM error envelope. + :vartype infeasibility_reason: ~azure.mgmt.containerserviceaimanager.models.InfeasibilityReason + """ + + vm_size: str = rest_field(name="vmSize", visibility=["read"]) + """Azure VM SKU, e.g. \"Standard_ND96isr_H100_v5\". Matches the value accepted by + ``ModelDeploymentProperties.vmSize``. Required.""" + quantization: Optional[str] = rest_field(visibility=["read"]) + """Resolved quantization on this SKU.""" + vms_per_replica: int = rest_field(name="vmsPerReplica", visibility=["read"]) + """Number of VMs required to host one replica on this SKU. Required.""" + max_available_replicas: int = rest_field(name="maxAvailableReplicas", visibility=["read"]) + """Maximum number of replicas the caller's subscription can deploy on this SKU today, computed + from the available GPU quota in the target region. Required.""" + serving_performance_estimation: Optional["_models.ServingPerformanceEstimation"] = rest_field( + name="servingPerformanceEstimation", visibility=["read"] + ) + """Estimated relative inference performance of a single model replica on this SKU. Omitted when an + estimate is unavailable.""" + vm_hourly_price: float = rest_field(name="vmHourlyPrice", visibility=["read"]) + """On-demand hourly price for a single VM of this SKU, in ``currency``. Required.""" + total_hourly_price: Optional[float] = rest_field(name="totalHourlyPrice", visibility=["read"]) + """Projected hourly cost for one replica (``vmsPerReplica`` VMs), in ``currency``.""" + price_as_of: Optional[datetime.datetime] = rest_field(name="priceAsOf", visibility=["read"], format="rfc3339") + """UTC timestamp of the price snapshot used for this plan.""" + feasible: bool = rest_field(visibility=["read"]) + """Whether the caller can actually deploy this plan today (region availability, GPU quota, model + fit, etc.). This field gates the mutually exclusive properties on this model: + + * When `feasible` is `true`: `totalHourlyPrice` is set and `infeasibilityReason` is + omitted. + * When `feasible` is `false`: `infeasibilityReason` is set and `totalHourlyPrice` is + omitted. Required.""" + infeasibility_reason: Optional["_models.InfeasibilityReason"] = rest_field( + name="infeasibilityReason", visibility=["read"] + ) + """Reason explaining why the plan is not deployable. This is a per-plan annotation, not an ARM + error envelope.""" + + +class CalculateCostRequest(_Model): + """Request body for the AI model ``calculateCost`` action.""" + + +class CalculateCostResponse(_Model): + """Response body for the AI model ``calculateCost`` action. + + :ivar currency: ISO 4217 currency code, e.g. "USD". Required. + :vartype currency: str + :ivar plans: Ranked list of GPU SKU pricing plans. Feasible plans first, ordered by + ``totalHourlyPrice`` ascending; infeasible plans last. Required. + :vartype plans: list[~azure.mgmt.containerserviceaimanager.models.CalculateCostPlan] + """ + + currency: str = rest_field(visibility=["read"]) + """ISO 4217 currency code, e.g. \"USD\". Required.""" + plans: list["_models.CalculateCostPlan"] = rest_field(visibility=["read"]) + """Ranked list of GPU SKU pricing plans. Feasible plans first, ordered by ``totalHourlyPrice`` + ascending; infeasible plans last. Required.""" + + +class CredentialResult(_Model): + """The credential result response. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytes + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the credential.""" + value: Optional[bytes] = rest_field(visibility=["read"], format="base64") + """Base64-encoded Kubernetes configuration file.""" + + +class CredentialResults(_Model): + """The list credential result response. + + :ivar kubeconfigs: Array of credential results. + :vartype kubeconfigs: list[~azure.mgmt.containerserviceaimanager.models.CredentialResult] + """ + + kubeconfigs: Optional[list["_models.CredentialResult"]] = rest_field(visibility=["read"]) + """Array of credential results.""" + + +class CredentialValue(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A credential value. Exactly one variant must be set. + + In the current API version, only the ``inline`` variant is supported. Future + API versions are expected to add additional credential kinds (for example, + managed identity and Key Vault secret references) as sibling variants on + this model. + + :ivar inline: An inline credential containing a secret value supplied in the request payload. + :vartype inline: ~azure.mgmt.containerserviceaimanager.models.InlineCredential + """ + + inline: Optional["_models.InlineCredential"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """An inline credential containing a secret value supplied in the request payload.""" + + @overload + def __init__( + self, + *, + inline: Optional["_models.InlineCredential"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.containerserviceaimanager.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.containerserviceaimanager.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.containerserviceaimanager.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InfeasibilityReason(_Model): + """Reason explaining why a ``CalculateCostPlan`` is not deployable. This is a per-plan annotation + surfaced inside a successful ``calculateCost`` response, not an ARM error envelope. + + :ivar code: Machine-readable reason code. Required. Known values are: "InsufficientQuota", + "RegionUnavailable", and "InefficientDeployment". + :vartype code: str or ~azure.mgmt.containerserviceaimanager.models.InfeasibleCode + :ivar message: Human-readable message accompanying ``code``. Required. + :vartype message: str + """ + + code: Union[str, "_models.InfeasibleCode"] = rest_field(visibility=["read"]) + """Machine-readable reason code. Required. Known values are: \"InsufficientQuota\", + \"RegionUnavailable\", and \"InefficientDeployment\".""" + message: str = rest_field(visibility=["read"]) + """Human-readable message accompanying ``code``. Required.""" + + +class InlineCredential(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A credential provided inline. + + :ivar value: The access token, password, or other secret value. Required. + :vartype value: str + """ + + value: str = rest_field(visibility=["create", "update"]) + """The access token, password, or other secret value. Required.""" + + @overload + def __init__( + self, + *, + value: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.containerserviceaimanager.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.containerserviceaimanager.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManualScalingProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Manual scaling configuration: fixed replica count. + + :ivar replicas: Fixed number of replicas. May be ``0`` to stop serving traffic while keeping + the deployment configuration (see ``ScalingProfile``). Required. + :vartype replicas: int + """ + + replicas: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fixed number of replicas. May be ``0`` to stop serving traffic while keeping the deployment + configuration (see ``ScalingProfile``). Required.""" + + @overload + def __init__( + self, + *, + replicas: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ModelDeployment(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A running deployment of a model in an AI Manager namespace. + + PUT (create or update) on this resource is a full replace: the request body + represents the complete desired state, and any optional property omitted + from the body is reset to its default value (or cleared, if it has no + default). Callers must always send the full desired state on every PUT. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.containerserviceaimanager.models.ModelDeploymentProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.ModelDeploymentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ModelDeploymentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ModelDeploymentOverrides(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """User overrides for a model deployment. + + :ivar values_property: Experimental free-form override key/value pairs. Subject to change + without notice; not part of the stable contract. Recognized keys are documented per release and + may be added, renamed, or removed at any time. + :vartype values_property: dict[str, str] + """ + + values_property: Optional[dict[str, str]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + """Experimental free-form override key/value pairs. Subject to change without notice; not part of + the stable contract. Recognized keys are documented per release and may be added, renamed, or + removed at any time.""" + + @overload + def __init__( + self, + *, + values_property: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ModelDeploymentProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model deployment properties. + + :ivar provisioning_state: The status of the last reconciliation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.containerserviceaimanager.models.ModelDeploymentProvisioningState + :ivar model_resource_id: Full ARM resource id of the model to deploy. Phase 1 accepts an + ``AIModel`` resource id only. Immutable after creation. Required. + :vartype model_resource_id: str + :ivar model_source_resource_id: Full ARM resource id of a ``ModelSource`` to use when pulling + artifacts for this deployment. Immutable after creation. + :vartype model_source_resource_id: str + :ivar performance_mode: Runtime performance mode. Known values are: "Balanced", "Latency", and + "Throughput". + :vartype performance_mode: str or + ~azure.mgmt.containerserviceaimanager.models.ModelDeploymentPerformanceMode + :ivar vm_size: Azure VM SKU used to host the deployment, e.g. "Standard_NC96ads_A100_v4". + Immutable after creation. Required. + :vartype vm_size: str + :ivar scale: Scaling configuration for the deployment. Provide either ``manual`` (fixed replica + count) or ``autoscale`` (autoscaling between min/max replicas), but not both. + :vartype scale: ~azure.mgmt.containerserviceaimanager.models.ScalingProfile + :ivar overrides: User overrides layered on top of profile resolution. + :vartype overrides: ~azure.mgmt.containerserviceaimanager.models.ModelDeploymentOverrides + :ivar status: Runtime status, populated once reconciliation begins. + :vartype status: ~azure.mgmt.containerserviceaimanager.models.ModelDeploymentStatus + """ + + provisioning_state: Optional[Union[str, "_models.ModelDeploymentProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last reconciliation. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" + model_resource_id: str = rest_field(name="modelResourceId", visibility=["read", "create"]) + """Full ARM resource id of the model to deploy. Phase 1 accepts an ``AIModel`` resource id only. + Immutable after creation. Required.""" + model_source_resource_id: Optional[str] = rest_field(name="modelSourceResourceId", visibility=["read", "create"]) + """Full ARM resource id of a ``ModelSource`` to use when pulling artifacts for this deployment. + Immutable after creation.""" + performance_mode: Optional[Union[str, "_models.ModelDeploymentPerformanceMode"]] = rest_field( + name="performanceMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Runtime performance mode. Known values are: \"Balanced\", \"Latency\", and \"Throughput\".""" + vm_size: str = rest_field(name="vmSize", visibility=["read", "create"]) + """Azure VM SKU used to host the deployment, e.g. \"Standard_NC96ads_A100_v4\". Immutable after + creation. Required.""" + scale: Optional["_models.ScalingProfile"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Scaling configuration for the deployment. Provide either ``manual`` (fixed replica count) or + ``autoscale`` (autoscaling between min/max replicas), but not both.""" + overrides: Optional["_models.ModelDeploymentOverrides"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """User overrides layered on top of profile resolution.""" + status: Optional["_models.ModelDeploymentStatus"] = rest_field(visibility=["read"]) + """Runtime status, populated once reconciliation begins.""" + + @overload + def __init__( + self, + *, + model_resource_id: str, + vm_size: str, + model_source_resource_id: Optional[str] = None, + performance_mode: Optional[Union[str, "_models.ModelDeploymentPerformanceMode"]] = None, + scale: Optional["_models.ScalingProfile"] = None, + overrides: Optional["_models.ModelDeploymentOverrides"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ModelDeploymentStatus(_Model): + """The runtime status of a model deployment. All fields are read-only and populated once + reconciliation has started. + + :ivar endpoint: The inference endpoint URL exposed by the deployment, once ready. + :vartype endpoint: str + :ivar engine: The inference engine used to serve the model, e.g. "vllm". + :vartype engine: str + :ivar engine_version: The version of the inference engine, e.g. "0.17". + :vartype engine_version: str + :ivar max_model_len: The maximum model context length, in tokens, configured for this + deployment. + :vartype max_model_len: int + :ivar quantization: The quantization level applied to the model weights, e.g. "fp16", + "awq-int4". + :vartype quantization: str + :ivar desired_replicas: The desired replica count reported by the controller. Equals + ``properties.scale.manual.replicas`` when manual scaling is used; current target replica count + derived from autoscaler otherwise. + :vartype desired_replicas: int + :ivar current_replicas: The current number of ready replicas serving traffic. + :vartype current_replicas: int + :ivar peak_tokens_per_minute: The peak tokens per minute measured by live stress test. + :vartype peak_tokens_per_minute: int + :ivar estimated_provision_time_seconds: Estimated total time, in seconds, for the deployment to + become ready end-to-end (GPU vm provisioning, image/weight pull, engine warm-up). + :vartype estimated_provision_time_seconds: int + """ + + endpoint: Optional[str] = rest_field(visibility=["read"]) + """The inference endpoint URL exposed by the deployment, once ready.""" + engine: Optional[str] = rest_field(visibility=["read"]) + """The inference engine used to serve the model, e.g. \"vllm\".""" + engine_version: Optional[str] = rest_field(name="engineVersion", visibility=["read"]) + """The version of the inference engine, e.g. \"0.17\".""" + max_model_len: Optional[int] = rest_field(name="maxModelLen", visibility=["read"]) + """The maximum model context length, in tokens, configured for this deployment.""" + quantization: Optional[str] = rest_field(visibility=["read"]) + """The quantization level applied to the model weights, e.g. \"fp16\", \"awq-int4\".""" + desired_replicas: Optional[int] = rest_field(name="desiredReplicas", visibility=["read"]) + """The desired replica count reported by the controller. Equals + ``properties.scale.manual.replicas`` when manual scaling is used; current target replica count + derived from autoscaler otherwise.""" + current_replicas: Optional[int] = rest_field(name="currentReplicas", visibility=["read"]) + """The current number of ready replicas serving traffic.""" + peak_tokens_per_minute: Optional[int] = rest_field(name="peakTokensPerMinute", visibility=["read"]) + """The peak tokens per minute measured by live stress test.""" + estimated_provision_time_seconds: Optional[int] = rest_field( + name="estimatedProvisionTimeSeconds", visibility=["read"] + ) + """Estimated total time, in seconds, for the deployment to become ready end-to-end (GPU vm + provisioning, image/weight pull, engine warm-up).""" + + +class ModelSource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A model source registered with an AI Manager. Describes an external model registry (e.g. + Hugging Face) and the credentials the platform uses to pull artifacts from it. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerserviceaimanager.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.containerserviceaimanager.models.ModelSourceProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.ModelSourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ModelSourceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ModelSourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Model source properties. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.containerserviceaimanager.models.ResourceProvisioningState + :ivar source_type: Model source type. Constrains the legal authentication kinds. Immutable + after creation. Required. "HuggingFace" + :vartype source_type: str or ~azure.mgmt.containerserviceaimanager.models.ModelSourceType + :ivar description: An optional, free-form description of the source. + :vartype description: str + :ivar credential: Credential the platform uses to authenticate to the source. Optional for + public sources (e.g. ungated Hugging Face models). + :vartype credential: ~azure.mgmt.containerserviceaimanager.models.CredentialValue + """ + + provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + source_type: Union[str, "_models.ModelSourceType"] = rest_field(name="sourceType", visibility=["read", "create"]) + """Model source type. Constrains the legal authentication kinds. Immutable after creation. + Required. \"HuggingFace\"""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An optional, free-form description of the source.""" + credential: Optional["_models.CredentialValue"] = rest_field(visibility=["create", "update"]) + """Credential the platform uses to authenticate to the source. Optional for public sources (e.g. + ungated Hugging Face models).""" + + @overload + def __init__( + self, + *, + source_type: Union[str, "_models.ModelSourceType"], + description: Optional[str] = None, + credential: Optional["_models.CredentialValue"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ModelSpec(_Model): + """The specification of a model. All fields are read-only. + + :ivar license: The license of the model, when known. SPDX license identifier, e.g. ``mit``, + ``apache-2.0``. + :vartype license: str + :ivar is_restricted: Whether access to the model is restricted and requires credential. + Required. + :vartype is_restricted: bool + :ivar max_context_length: The maximum context length supported by the model, in tokens. + Required. + :vartype max_context_length: int + """ + + license: Optional[str] = rest_field(visibility=["read"]) + """The license of the model, when known. SPDX license identifier, e.g. ``mit``, ``apache-2.0``.""" + is_restricted: bool = rest_field(name="isRestricted", visibility=["read"]) + """Whether access to the model is restricted and requires credential. Required.""" + max_context_length: int = rest_field(name="maxContextLength", visibility=["read"]) + """The maximum context length supported by the model, in tokens. Required.""" + + +class NamespaceAccessInfo(_Model): + """Access information for an AI Manager namespace, including the OpenAI-compatible gateway + endpoint and the API keys used to authenticate against it. + + :ivar endpoint: OpenAI-compatible inference gateway base URL (for example, + ``https://team-alpha...aksapp.io/v1``). Required. + :vartype endpoint: str + :ivar primary_key: Primary API key. Send as ``Authorization: Bearer `` or ``api-key: + ``. Treat as secret; do not log or persist in plaintext. Required. + :vartype primary_key: str + :ivar secondary_key: Secondary API key, accepted by the gateway in the same headers as + ``primaryKey``. Generated independently when the namespace is created, then overwritten by the + previous ``primaryKey`` on each ``rotateKeys`` call so clients can roll over without downtime. + Treat as secret; do not log or persist in plaintext. Required. + :vartype secondary_key: str + :ivar last_rotated_at: UTC time the keys were last rotated by ``rotateKeys``. Absent until the + first rotation. Clients can use this to detect rotation and refresh cached credentials. + :vartype last_rotated_at: ~datetime.datetime + """ + + endpoint: str = rest_field(visibility=["read"]) + """OpenAI-compatible inference gateway base URL (for example, + ``https://team-alpha...aksapp.io/v1``). Required.""" + primary_key: str = rest_field(name="primaryKey", visibility=["read"]) + """Primary API key. Send as ``Authorization: Bearer `` or ``api-key: ``. Treat as + secret; do not log or persist in plaintext. Required.""" + secondary_key: str = rest_field(name="secondaryKey", visibility=["read"]) + """Secondary API key, accepted by the gateway in the same headers as ``primaryKey``. Generated + independently when the namespace is created, then overwritten by the previous ``primaryKey`` on + each ``rotateKeys`` call so clients can roll over without downtime. Treat as secret; do not log + or persist in plaintext. Required.""" + last_rotated_at: Optional[datetime.datetime] = rest_field( + name="lastRotatedAt", visibility=["read"], format="rfc3339" + ) + """UTC time the keys were last rotated by ``rotateKeys``. Absent until the first rotation. Clients + can use this to detect rotation and refresh cached credentials.""" + + +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.containerserviceaimanager.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.containerserviceaimanager.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.containerserviceaimanager.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDisplay(_Model): + """Localized display information for an operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class ScalingProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Scaling configuration for a model deployment. Exactly one of ``manual`` or + ``autoscale`` must be set. + + This mutual-exclusion constraint is enforced by the service at request + validation time, not by the schema. A PUT request that sets both ``manual`` + and ``autoscale``, or sets neither, is rejected with HTTP 400 (Bad Request) + and an ``InvalidScalingProfile`` error code; + + Scale-to-zero semantics differ between the two modes: + + * `manual` permits `replicas: 0`. This is an explicit operator action to + stop serving traffic while keeping the `ModelDeployment` resource (and + its configuration) in place. While at zero replicas the endpoint + returns errors for inference requests, and the deployment releases its + GPU capacity. + * `autoscale` does not permit `minReplicas: 0`. Autoscaling decisions are + driven by serving-server runtime metrics (request rate, queue depth, + GPU utilization); at zero replicas there is no signal for the + autoscaler to scale back up from. Combined with GPU cold-start time + (on the order of minutes) and constrained regional GPU capacity, a + scale-from-zero event would produce unacceptable first-request latency + and a high risk of capacity unavailability. Callers that want + autoscaling with an idle state should delete the `ModelDeployment` + instead. + + :ivar manual: Manual scaling configuration with a fixed replica count. Mutually exclusive with + ``autoscale``. + :vartype manual: ~azure.mgmt.containerserviceaimanager.models.ManualScalingProfile + :ivar autoscale: Autoscaling configuration. Mutually exclusive with ``manual``. + :vartype autoscale: ~azure.mgmt.containerserviceaimanager.models.AutoscaleProfile + """ + + manual: Optional["_models.ManualScalingProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Manual scaling configuration with a fixed replica count. Mutually exclusive with ``autoscale``.""" + autoscale: Optional["_models.AutoscaleProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Autoscaling configuration. Mutually exclusive with ``manual``.""" + + @overload + def __init__( + self, + *, + manual: Optional["_models.ManualScalingProfile"] = None, + autoscale: Optional["_models.AutoscaleProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServingPerformanceEstimation(_Model): + """Estimated relative inference performance of a single model replica on a given GPU SKU. Each + metric is a scaling coefficient in the range ``[0, 1]`` relative to the best-performing SKU for + this model, which scores ``1``. + + :ivar relative_latency_score: Relative inference latency score in ``[0, 1]``. Higher is better + (``1`` matches the best-performing SKU's latency for this model). Note: this is a normalized + score, not a raw latency ratio -- a larger value indicates lower latency. Required. + :vartype relative_latency_score: float + :ivar relative_throughput_score: Relative inference throughput score in ``[0, 1]``. Higher is + better (``1`` matches the best-performing SKU's throughput for this model). Required. + :vartype relative_throughput_score: float + """ + + relative_latency_score: float = rest_field(name="relativeLatencyScore", visibility=["read"]) + """Relative inference latency score in ``[0, 1]``. Higher is better (``1`` matches the + best-performing SKU's latency for this model). Note: this is a normalized score, not a raw + latency ratio -- a larger value indicates lower latency. Required.""" + relative_throughput_score: float = rest_field(name="relativeThroughputScore", visibility=["read"]) + """Relative inference throughput score in ``[0, 1]``. Higher is better (``1`` matches the + best-performing SKU's throughput for this model). Required.""" + + +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.containerserviceaimanager.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or + ~azure.mgmt.containerserviceaimanager.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_patch.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_patch.py new file mode 100644 index 00000000000..87676c65a8f --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/__init__.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/__init__.py new file mode 100644 index 00000000000..f15411ea000 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/__init__.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._operations import AIManagersOperations # type: ignore +from ._operations import AIManagerNamespacesOperations # type: ignore +from ._operations import AIModelsOperations # type: ignore +from ._operations import ModelSourcesOperations # type: ignore +from ._operations import ModelDeploymentsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "AIManagersOperations", + "AIManagerNamespacesOperations", + "AIModelsOperations", + "ModelSourcesOperations", + "ModelDeploymentsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_operations.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_operations.py new file mode 100644 index 00000000000..4be9d33aed3 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_operations.py @@ -0,0 +1,4850 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core import MatchConditions, PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceModifiedError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models, types as _types +from .._configuration import ContainerServiceAIManagerMgmtClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._utils.utils import prep_if_match, prep_if_none_match +from .._validation import api_version_validation + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.ContainerService/operations" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_get_request( + resource_group_name: str, ai_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_manager_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_update_request( + resource_group_name: str, + ai_manager_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_delete_request( + resource_group_name: str, + ai_manager_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/aiManagers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_managers_list_credential_request( # pylint: disable=name-too-long + resource_group_name: str, ai_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/listCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_get_request( + resource_group_name: str, ai_manager_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_list_by_ai_manager_request( # pylint: disable=name-too-long + resource_group_name: str, ai_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_list_credential_request( # pylint: disable=name-too-long + resource_group_name: str, ai_manager_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/listCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_list_access_keys_request( # pylint: disable=name-too-long + resource_group_name: str, ai_manager_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/listAccessKeys" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_manager_namespaces_rotate_keys_request( # pylint: disable=name-too-long + resource_group_name: str, ai_manager_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/rotateKeys" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_models_get_request(location: str, ai_model_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/aiModels/{aiModelName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "aiModelName": _SERIALIZER.url("ai_model_name", ai_model_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_models_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/aiModels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ai_models_calculate_cost_request( + location: str, ai_model_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/aiModels/{aiModelName}/calculateCost" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "aiModelName": _SERIALIZER.url("ai_model_name", ai_model_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_sources_get_request( + resource_group_name: str, ai_manager_name: str, model_source_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/modelSources/{modelSourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "modelSourceName": _SERIALIZER.url("model_source_name", model_source_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_sources_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/modelSources/{modelSourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "modelSourceName": _SERIALIZER.url("model_source_name", model_source_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_sources_delete_request( + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/modelSources/{modelSourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "modelSourceName": _SERIALIZER.url("model_source_name", model_source_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_sources_list_request( + resource_group_name: str, ai_manager_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/modelSources" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_deployments_get_request( + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/modelDeployments/{modelDeploymentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "modelDeploymentName": _SERIALIZER.url("model_deployment_name", model_deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_deployments_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/modelDeployments/{modelDeploymentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "modelDeploymentName": _SERIALIZER.url("model_deployment_name", model_deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_deployments_delete_request( + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/modelDeployments/{modelDeploymentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "modelDeploymentName": _SERIALIZER.url("model_deployment_name", model_deployment_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["if-none-match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_model_deployments_list_by_ai_manager_namespace_request( # pylint: disable=name-too-long + resource_group_name: str, ai_manager_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces/{namespaceName}/modelDeployments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "aiManagerName": _SERIALIZER.url("ai_manager_name", ai_manager_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.ContainerServiceAIManagerMgmtClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class AIManagersOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.ContainerServiceAIManagerMgmtClient`'s + :attr:`ai_managers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, ai_manager_name: str, **kwargs: Any) -> _models.AIManager: + """Get a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AIManager] = kwargs.pop("cls", None) + + _request = build_ai_managers_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIManager, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + resource: Union[_models.AIManager, _types.AIManager, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_managers_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: _models.AIManager, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManager + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: _types.AIManager, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.AIManager + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + resource: Union[_models.AIManager, _types.AIManager, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManager]: + """Create a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param resource: Resource create parameters. Is either a AIManager type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManager or + ~azure.mgmt.containerserviceaimanager.types.AIManager or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManager. The AIManager is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AIManager] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AIManager, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AIManager].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AIManager]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: _models.AIManagerPatch, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.containerserviceaimanager.models.AIManagerPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: _types.AIManagerPatch, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.containerserviceaimanager.types.AIManagerPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + ai_manager_name: str, + properties: Union[_models.AIManagerPatch, _types.AIManagerPatch, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> _models.AIManager: + """Update a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param properties: The resource properties to be updated. Is either a AIManagerPatch type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.containerserviceaimanager.models.AIManagerPatch or + ~azure.mgmt.containerserviceaimanager.types.AIManagerPatch or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: AIManager. The AIManager is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManager + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AIManager] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_managers_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIManager, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ai_managers_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.AIManager"]: + """List AIManager resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of AIManager + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIManager]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_managers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIManager], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.AIManager"]: + """List AIManager resources by subscription ID. + + :return: An iterator like instance of AIManager + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.AIManager] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIManager]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_managers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIManager], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_credential( + self, resource_group_name: str, ai_manager_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of an AI Manager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_ai_managers_list_credential_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AIManagerNamespacesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.ContainerServiceAIManagerMgmtClient`'s + :attr:`ai_manager_namespaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.AIManagerNamespace: + """Get a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: AIManagerNamespace. The AIManagerNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AIManagerNamespace] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIManagerNamespace, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: Union[_models.AIManagerNamespace, _types.AIManagerNamespace, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_manager_namespaces_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: _models.AIManagerNamespace, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManagerNamespace. The AIManagerNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: _types.AIManagerNamespace, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.AIManagerNamespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManagerNamespace. The AIManagerNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManagerNamespace. The AIManagerNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + resource: Union[_models.AIManagerNamespace, _types.AIManagerNamespace, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AIManagerNamespace]: + """Create a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param resource: Resource create parameters. Is either a AIManagerNamespace type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace or + ~azure.mgmt.containerserviceaimanager.types.AIManagerNamespace or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AIManagerNamespace. The AIManagerNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AIManagerNamespace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AIManagerNamespace, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AIManagerNamespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AIManagerNamespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_ai_manager( + self, resource_group_name: str, ai_manager_name: str, **kwargs: Any + ) -> ItemPaged["_models.AIManagerNamespace"]: + """List AIManagerNamespace resources by AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: An iterator like instance of AIManagerNamespace + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.AIManagerNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIManagerNamespace]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_manager_namespaces_list_by_ai_manager_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIManagerNamespace], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_credential( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of an AI Manager namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_list_credential_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def list_access_keys( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.NamespaceAccessInfo: + """Returns the namespace-scoped LLM gateway endpoint and the current API keys. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: NamespaceAccessInfo. The NamespaceAccessInfo is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.NamespaceAccessInfo + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceAccessInfo] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_list_access_keys_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceAccessInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def rotate_keys( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> _models.NamespaceAccessInfo: + """Rotates the namespace-scoped LLM gateway API keys. A new key is generated and installed as + ``primaryKey``, and the previous ``primaryKey`` overwrites ``secondaryKey`` so clients can roll + over without downtime. Returns the updated access info. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: NamespaceAccessInfo. The NamespaceAccessInfo is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.NamespaceAccessInfo + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceAccessInfo] = kwargs.pop("cls", None) + + _request = build_ai_manager_namespaces_rotate_keys_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceAccessInfo, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AIModelsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.ContainerServiceAIManagerMgmtClient`'s + :attr:`ai_models` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": ["api_version", "subscription_id", "location", "ai_model_name", "accept"] + }, + api_versions_list=["2026-05-02-preview"], + ) + def get(self, location: str, ai_model_name: str, **kwargs: Any) -> _models.AIModel: + """Get a AIModel. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :return: AIModel. The AIModel is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.AIModel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AIModel] = kwargs.pop("cls", None) + + _request = build_ai_models_get_request( + location=location, + ai_model_name=ai_model_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AIModel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={"2026-05-02-preview": ["api_version", "subscription_id", "location", "accept"]}, + api_versions_list=["2026-05-02-preview"], + ) + def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.AIModel"]: + """List AIModel resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of AIModel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.AIModel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AIModel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ai_models_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AIModel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def calculate_cost( + self, + location: str, + ai_model_name: str, + body: _models.CalculateCostRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.containerserviceaimanager.models.CalculateCostRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def calculate_cost( + self, + location: str, + ai_model_name: str, + body: _types.CalculateCostRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.containerserviceaimanager.types.CalculateCostRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def calculate_cost( + self, + location: str, + ai_model_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "location", + "ai_model_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def calculate_cost( + self, + location: str, + ai_model_name: str, + body: Union[_models.CalculateCostRequest, _types.CalculateCostRequest, IO[bytes]], + **kwargs: Any + ) -> _models.CalculateCostResponse: + """Returns a ranked list of GPU SKU pricing plans for deploying this model in the target region, + each annotated with feasibility, per-replica hourly cost, and estimated relative performance. + No Azure or Kubernetes resources are provisioned. + + :param location: The name of the Azure region. Required. + :type location: str + :param ai_model_name: The name of the AI model resource. A stable, format-defined identifier + derived from ``modelId`` as the lowercase hex of the first 8 bytes (16 characters) of + ``SHA-256(modelId)`` (e.g. upstream ``microsoft/Phi-4-mini-instruct`` produces + ``9806f0c862fdd920``). Callers should treat the name as opaque and use the ``modelId`` property + as the human-readable reference. The encoding is a permanent contract of this resource provider + and does not depend on any upstream naming policy. Required. + :type ai_model_name: str + :param body: The content of the action request. Is either a CalculateCostRequest type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.containerserviceaimanager.models.CalculateCostRequest or + ~azure.mgmt.containerserviceaimanager.types.CalculateCostRequest or IO[bytes] + :return: CalculateCostResponse. The CalculateCostResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.CalculateCostResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CalculateCostResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ai_models_calculate_cost_request( + location=location, + ai_model_name=ai_model_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CalculateCostResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ModelSourcesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.ContainerServiceAIManagerMgmtClient`'s + :attr:`model_sources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def get( + self, resource_group_name: str, ai_manager_name: str, model_source_name: str, **kwargs: Any + ) -> _models.ModelSource: + """Get a ModelSource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :return: ModelSource. The ModelSource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.ModelSource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ModelSource] = kwargs.pop("cls", None) + + _request = build_model_sources_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ModelSource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: Union[_models.ModelSource, _types.ModelSource, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_sources_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: _models.ModelSource, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelSource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelSource. The ModelSource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: _types.ModelSource, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.ModelSource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelSource. The ModelSource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelSource. The ModelSource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + resource: Union[_models.ModelSource, _types.ModelSource, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelSource]: + """Create or update a ``ModelSource``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :param resource: Resource create parameters. Is either a ModelSource type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelSource or + ~azure.mgmt.containerserviceaimanager.types.ModelSource or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelSource. The ModelSource is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ModelSource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ModelSource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ModelSource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ModelSource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_model_sources_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "model_source_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + model_source_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a ModelSource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param model_source_name: The name of the model source resource. Required. + :type model_source_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + model_source_name=model_source_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": ["api_version", "subscription_id", "resource_group_name", "ai_manager_name", "accept"] + }, + api_versions_list=["2026-05-02-preview"], + ) + def list(self, resource_group_name: str, ai_manager_name: str, **kwargs: Any) -> ItemPaged["_models.ModelSource"]: + """List ModelSource resources by AIManager. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :return: An iterator like instance of ModelSource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.ModelSource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ModelSource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_model_sources_list_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ModelSource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ModelDeploymentsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerserviceaimanager.ContainerServiceAIManagerMgmtClient`'s + :attr:`model_deployments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceAIManagerMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def get( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + **kwargs: Any + ) -> _models.ModelDeployment: + """Get a ModelDeployment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :return: ModelDeployment. The ModelDeployment is compatible with MutableMapping + :rtype: ~azure.mgmt.containerserviceaimanager.models.ModelDeployment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ModelDeployment] = kwargs.pop("cls", None) + + _request = build_model_deployments_get_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ModelDeployment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: Union[_models.ModelDeployment, _types.ModelDeployment, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_model_deployments_create_or_update_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: _models.ModelDeployment, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelDeployment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: _types.ModelDeployment, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.types.ModelDeployment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + resource: Union[_models.ModelDeployment, _types.ModelDeployment, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ModelDeployment]: + """Create or update a ``ModelDeployment``. This is a full-replace operation: any optional property + omitted from the request body is reset to its default value, or cleared if it has no default. + To safely modify a subset of fields, perform a GET, modify the returned resource, and PUT it + back using the returned ETag via the ``If-Match`` header to avoid concurrent overwrites. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :param resource: Resource create parameters. Is either a ModelDeployment type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.containerserviceaimanager.models.ModelDeployment or + ~azure.mgmt.containerserviceaimanager.types.ModelDeployment or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ModelDeployment. The ModelDeployment is + compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ModelDeployment] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + resource=resource, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ModelDeployment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ModelDeployment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ModelDeployment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def _delete_initial( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_model_deployments_delete_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "model_deployment_name", + "etag", + "match_condition", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def begin_delete( + self, + resource_group_name: str, + ai_manager_name: str, + namespace_name: str, + model_deployment_name: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a ModelDeployment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :param model_deployment_name: The name of the model deployment resource. Required. + :type model_deployment_name: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + model_deployment_name=model_deployment_name, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-02-preview", + params_added_on={ + "2026-05-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "ai_manager_name", + "namespace_name", + "accept", + ] + }, + api_versions_list=["2026-05-02-preview"], + ) + def list_by_ai_manager_namespace( + self, resource_group_name: str, ai_manager_name: str, namespace_name: str, **kwargs: Any + ) -> ItemPaged["_models.ModelDeployment"]: + """List ModelDeployment resources by AIManagerNamespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param ai_manager_name: The name of the AI Manager resource. Required. + :type ai_manager_name: str + :param namespace_name: The name of the AI Manager namespace resource. Required. + :type namespace_name: str + :return: An iterator like instance of ModelDeployment + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerserviceaimanager.models.ModelDeployment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ModelDeployment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_model_deployments_list_by_ai_manager_namespace_request( + resource_group_name=resource_group_name, + ai_manager_name=ai_manager_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ModelDeployment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_patch.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_patch.py new file mode 100644 index 00000000000..87676c65a8f --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_patch.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/py.typed b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/types.py b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/types.py new file mode 100644 index 00000000000..7f569b30fe6 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/types.py @@ -0,0 +1,625 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + AIManagerNamespaceProvisioningState, + AIManagerProvisioningState, + CreatedByType, + DeletePolicy, + ManagedServiceIdentityType, + ModelDeploymentPerformanceMode, + ModelDeploymentProvisioningState, + ModelSourceType, + ResourceProvisioningState, + ) + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class AIManager(TrackedResource): + """The AI Manager resource. For more information, see `https://aka.ms/aks/aimanager + `_. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "AIManagerProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "AIManagerProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class AIManagerNamespace(ProxyResource): + """The AI Manager namespace resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "AIManagerNamespaceProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: "AIManagerNamespaceProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class AIManagerNamespaceProperties(TypedDict, total=False): + """AI Manager namespace properties. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioningState: Union[str, "AIManagerNamespaceProvisioningState"] + :ivar labels: Labels applied to the Kubernetes namespace. + :vartype labels: dict[str, str] + :ivar annotations: Annotations applied to the Kubernetes namespace. + :vartype annotations: dict[str, str] + """ + + provisioningState: Union[str, "AIManagerNamespaceProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Creating\", \"Updating\", and \"Deleting\".""" + labels: dict[str, str] + """Labels applied to the Kubernetes namespace.""" + annotations: dict[str, str] + """Annotations applied to the Kubernetes namespace.""" + + +class AIManagerPatch(TypedDict, total=False): + """The AI Manager resource patch model. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class AIManagerProperties(TypedDict, total=False): + """AI Manager properties. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioningState: Union[str, "AIManagerProvisioningState"] + :ivar deletePolicy: Delete options of the AI Manager. Defaults to ``Delete`` if not specified. + Known values are: "Keep" and "Delete". + :vartype deletePolicy: Union[str, "DeletePolicy"] + :ivar managedResourceGroupName: The name of the managed resource group created by the AI + Manager to hold underlying infrastructure resources. + :vartype managedResourceGroupName: str + """ + + provisioningState: Union[str, "AIManagerProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Creating\", \"Updating\", and \"Deleting\".""" + deletePolicy: Union[str, "DeletePolicy"] + """Delete options of the AI Manager. Defaults to ``Delete`` if not specified. Known values are: + \"Keep\" and \"Delete\".""" + managedResourceGroupName: str + """The name of the managed resource group created by the AI Manager to hold underlying + infrastructure resources.""" + + +class AutoscaleProfile(TypedDict, total=False): + """Autoscaling configuration: scale replica count between a minimum and maximum. + + :ivar minReplicas: The minimum number of replicas. Must be at least ``1``; scale-to-zero is not + supported in autoscale mode (see ``ScalingProfile``). Required. + :vartype minReplicas: int + :ivar maxReplicas: The maximum number of replicas. If not specified, the service derives a + default from the subscription GPU quota. + :vartype maxReplicas: int + """ + + minReplicas: Required[int] + """The minimum number of replicas. Must be at least ``1``; scale-to-zero is not supported in + autoscale mode (see ``ScalingProfile``). Required.""" + maxReplicas: int + """The maximum number of replicas. If not specified, the service derives a default from the + subscription GPU quota.""" + + +class CalculateCostRequest(TypedDict, total=False): + """Request body for the AI model ``calculateCost`` action.""" + + +class CredentialValue(TypedDict, total=False): + """A credential value. Exactly one variant must be set. + + In the current API version, only the ``inline`` variant is supported. Future + API versions are expected to add additional credential kinds (for example, + managed identity and Key Vault secret references) as sibling variants on + this model. + + :ivar inline: An inline credential containing a secret value supplied in the request payload. + :vartype inline: "InlineCredential" + """ + + inline: "InlineCredential" + """An inline credential containing a secret value supplied in the request payload.""" + + +class InlineCredential(TypedDict, total=False): + """A credential provided inline. + + :ivar value: The access token, password, or other secret value. Required. + :vartype value: str + """ + + value: Required[str] + """The access token, password, or other secret value. Required.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class ManualScalingProfile(TypedDict, total=False): + """Manual scaling configuration: fixed replica count. + + :ivar replicas: Fixed number of replicas. May be ``0`` to stop serving traffic while keeping + the deployment configuration (see ``ScalingProfile``). Required. + :vartype replicas: int + """ + + replicas: Required[int] + """Fixed number of replicas. May be ``0`` to stop serving traffic while keeping the deployment + configuration (see ``ScalingProfile``). Required.""" + + +class ModelDeployment(ProxyResource): + """A running deployment of a model in an AI Manager namespace. + + PUT (create or update) on this resource is a full replace: the request body + represents the complete desired state, and any optional property omitted + from the body is reset to its default value (or cleared, if it has no + default). Callers must always send the full desired state on every PUT. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "ModelDeploymentProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: "ModelDeploymentProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class ModelDeploymentOverrides(TypedDict, total=False): + """User overrides for a model deployment. + + :ivar values: Experimental free-form override key/value pairs. Subject to change without + notice; not part of the stable contract. Recognized keys are documented per release and may be + added, renamed, or removed at any time. + :vartype values: dict[str, str] + """ + + values: dict[str, str] + """Experimental free-form override key/value pairs. Subject to change without notice; not part of + the stable contract. Recognized keys are documented per release and may be added, renamed, or + removed at any time.""" + + +class ModelDeploymentProperties(TypedDict, total=False): + """Model deployment properties. + + :ivar provisioningState: The status of the last reconciliation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioningState: Union[str, "ModelDeploymentProvisioningState"] + :ivar modelResourceId: Full ARM resource id of the model to deploy. Phase 1 accepts an + ``AIModel`` resource id only. Immutable after creation. Required. + :vartype modelResourceId: str + :ivar modelSourceResourceId: Full ARM resource id of a ``ModelSource`` to use when pulling + artifacts for this deployment. Immutable after creation. + :vartype modelSourceResourceId: str + :ivar performanceMode: Runtime performance mode. Known values are: "Balanced", "Latency", and + "Throughput". + :vartype performanceMode: Union[str, "ModelDeploymentPerformanceMode"] + :ivar vmSize: Azure VM SKU used to host the deployment, e.g. "Standard_NC96ads_A100_v4". + Immutable after creation. Required. + :vartype vmSize: str + :ivar scale: Scaling configuration for the deployment. Provide either ``manual`` (fixed replica + count) or ``autoscale`` (autoscaling between min/max replicas), but not both. + :vartype scale: "ScalingProfile" + :ivar overrides: User overrides layered on top of profile resolution. + :vartype overrides: "ModelDeploymentOverrides" + :ivar status: Runtime status, populated once reconciliation begins. + :vartype status: "ModelDeploymentStatus" + """ + + provisioningState: Union[str, "ModelDeploymentProvisioningState"] + """The status of the last reconciliation. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" + modelResourceId: Required[str] + """Full ARM resource id of the model to deploy. Phase 1 accepts an ``AIModel`` resource id only. + Immutable after creation. Required.""" + modelSourceResourceId: str + """Full ARM resource id of a ``ModelSource`` to use when pulling artifacts for this deployment. + Immutable after creation.""" + performanceMode: Union[str, "ModelDeploymentPerformanceMode"] + """Runtime performance mode. Known values are: \"Balanced\", \"Latency\", and \"Throughput\".""" + vmSize: Required[str] + """Azure VM SKU used to host the deployment, e.g. \"Standard_NC96ads_A100_v4\". Immutable after + creation. Required.""" + scale: "ScalingProfile" + """Scaling configuration for the deployment. Provide either ``manual`` (fixed replica count) or + ``autoscale`` (autoscaling between min/max replicas), but not both.""" + overrides: "ModelDeploymentOverrides" + """User overrides layered on top of profile resolution.""" + status: "ModelDeploymentStatus" + """Runtime status, populated once reconciliation begins.""" + + +class ModelDeploymentStatus(TypedDict, total=False): + """The runtime status of a model deployment. All fields are read-only and populated once + reconciliation has started. + + :ivar endpoint: The inference endpoint URL exposed by the deployment, once ready. + :vartype endpoint: str + :ivar engine: The inference engine used to serve the model, e.g. "vllm". + :vartype engine: str + :ivar engineVersion: The version of the inference engine, e.g. "0.17". + :vartype engineVersion: str + :ivar maxModelLen: The maximum model context length, in tokens, configured for this deployment. + :vartype maxModelLen: int + :ivar quantization: The quantization level applied to the model weights, e.g. "fp16", + "awq-int4". + :vartype quantization: str + :ivar desiredReplicas: The desired replica count reported by the controller. Equals + ``properties.scale.manual.replicas`` when manual scaling is used; current target replica count + derived from autoscaler otherwise. + :vartype desiredReplicas: int + :ivar currentReplicas: The current number of ready replicas serving traffic. + :vartype currentReplicas: int + :ivar peakTokensPerMinute: The peak tokens per minute measured by live stress test. + :vartype peakTokensPerMinute: int + :ivar estimatedProvisionTimeSeconds: Estimated total time, in seconds, for the deployment to + become ready end-to-end (GPU vm provisioning, image/weight pull, engine warm-up). + :vartype estimatedProvisionTimeSeconds: int + """ + + endpoint: str + """The inference endpoint URL exposed by the deployment, once ready.""" + engine: str + """The inference engine used to serve the model, e.g. \"vllm\".""" + engineVersion: str + """The version of the inference engine, e.g. \"0.17\".""" + maxModelLen: int + """The maximum model context length, in tokens, configured for this deployment.""" + quantization: str + """The quantization level applied to the model weights, e.g. \"fp16\", \"awq-int4\".""" + desiredReplicas: int + """The desired replica count reported by the controller. Equals + ``properties.scale.manual.replicas`` when manual scaling is used; current target replica count + derived from autoscaler otherwise.""" + currentReplicas: int + """The current number of ready replicas serving traffic.""" + peakTokensPerMinute: int + """The peak tokens per minute measured by live stress test.""" + estimatedProvisionTimeSeconds: int + """Estimated total time, in seconds, for the deployment to become ready end-to-end (GPU vm + provisioning, image/weight pull, engine warm-up).""" + + +class ModelSource(ProxyResource): + """A model source registered with an AI Manager. Describes an external model registry (e.g. + Hugging Face) and the credentials the platform uses to pull artifacts from it. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "ModelSourceProperties" + :ivar eTag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype eTag: str + """ + + properties: "ModelSourceProperties" + """The resource-specific properties for this resource.""" + eTag: str + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + +class ModelSourceProperties(TypedDict, total=False): + """Model source properties. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ResourceProvisioningState"] + :ivar sourceType: Model source type. Constrains the legal authentication kinds. Immutable after + creation. Required. "HuggingFace" + :vartype sourceType: Union[str, "ModelSourceType"] + :ivar description: An optional, free-form description of the source. + :vartype description: str + :ivar credential: Credential the platform uses to authenticate to the source. Optional for + public sources (e.g. ungated Hugging Face models). + :vartype credential: "CredentialValue" + """ + + provisioningState: Union[str, "ResourceProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", and + \"Canceled\".""" + sourceType: Required[Union[str, "ModelSourceType"]] + """Model source type. Constrains the legal authentication kinds. Immutable after creation. + Required. \"HuggingFace\"""" + description: str + """An optional, free-form description of the source.""" + credential: "CredentialValue" + """Credential the platform uses to authenticate to the source. Optional for public sources (e.g. + ungated Hugging Face models).""" + + +class ScalingProfile(TypedDict, total=False): + """Scaling configuration for a model deployment. Exactly one of ``manual`` or + ``autoscale`` must be set. + + This mutual-exclusion constraint is enforced by the service at request + validation time, not by the schema. A PUT request that sets both ``manual`` + and ``autoscale``, or sets neither, is rejected with HTTP 400 (Bad Request) + and an ``InvalidScalingProfile`` error code; + + Scale-to-zero semantics differ between the two modes: + + * `manual` permits `replicas: 0`. This is an explicit operator action to + stop serving traffic while keeping the `ModelDeployment` resource (and + its configuration) in place. While at zero replicas the endpoint + returns errors for inference requests, and the deployment releases its + GPU capacity. + * `autoscale` does not permit `minReplicas: 0`. Autoscaling decisions are + driven by serving-server runtime metrics (request rate, queue depth, + GPU utilization); at zero replicas there is no signal for the + autoscaler to scale back up from. Combined with GPU cold-start time + (on the order of minutes) and constrained regional GPU capacity, a + scale-from-zero event would produce unacceptable first-request latency + and a high risk of capacity unavailability. Callers that want + autoscaling with an idle state should delete the `ModelDeployment` + instead. + + :ivar manual: Manual scaling configuration with a fixed replica count. Mutually exclusive with + ``autoscale``. + :vartype manual: "ManualScalingProfile" + :ivar autoscale: Autoscaling configuration. Mutually exclusive with ``manual``. + :vartype autoscale: "AutoscaleProfile" + """ + + manual: "ManualScalingProfile" + """Manual scaling configuration with a fixed replica count. Mutually exclusive with ``autoscale``.""" + autoscale: "AutoscaleProfile" + """Autoscaling configuration. Mutually exclusive with ``manual``.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" diff --git a/src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py b/src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py deleted file mode 100644 index 1a5fd05a690..00000000000 --- a/src/aks-preview/azext_aks_preview/aks_inference/_client_factory.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Client factory — the classic equivalent of `_client_factory.py:22` (cf_managed_clusters).""" - -from azure.cli.core.commands.client_factory import get_mgmt_service_client -from azure.cli.core.profiles import ResourceType # noqa: F401 (real code registers a custom profile) - -from .vendored_sdk import AIManagerMgmtClient - - -def cf_ai_managers(cli_ctx, *_): - # get_mgmt_service_client wires up the credential, subscription id, ARM base url and - # cloud-specific scopes, then instantiates our (vendored) client. - client = get_mgmt_service_client(cli_ctx, AIManagerMgmtClient) - return client.ai_managers - - -def cf_ai_manager_namespaces(cli_ctx, *_): - client = get_mgmt_service_client(cli_ctx, AIManagerMgmtClient) - return client.ai_manager_namespaces diff --git a/src/aks-preview/azext_aks_preview/aks_inference/_help.py b/src/aks-preview/azext_aks_preview/aks_inference/_help.py deleted file mode 100644 index 4da0d8a036a..00000000000 --- a/src/aks-preview/azext_aks_preview/aks_inference/_help.py +++ /dev/null @@ -1,93 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Help definitions — the classic equivalent of `_help.py`. - -Unlike AAZ (where the command class docstring is the help), classic command -modules register help as YAML strings in the `helps` dict. Import this module -once (e.g. from the extension's real `_help.py`) so the strings get registered. -""" - -from knack.help_files import helps - - -helps['aks inference'] = """ - type: group - short-summary: Manage AI Manager resources for inference on AKS. -""" - -helps['aks inference create'] = """ - type: command - short-summary: Create an AI Manager resource. - examples: - - name: Create an AI Manager - text: az aks inference create --name my-ai-manager -g myrg -l eastus2 - - name: Create an AI Manager with the Keep delete policy - text: az aks inference create --name my-ai-manager -g myrg -l eastus2 --delete-policy Keep -""" - -helps['aks inference show'] = """ - type: command - short-summary: Show the details of an AI Manager resource. - examples: - - name: Show an AI Manager - text: az aks inference show --name my-ai-manager -g myrg -""" - -helps['aks inference delete'] = """ - type: command - short-summary: Delete an AI Manager resource. - examples: - - name: Delete an AI Manager - text: az aks inference delete --name my-ai-manager -g myrg -""" - -helps['aks inference list'] = """ - type: command - short-summary: List AI Manager resources. - examples: - - name: List AI Managers in a resource group - text: az aks inference list -g myrg - - name: List all AI Managers in the subscription - text: az aks inference list -""" - -helps['aks inference namespace'] = """ - type: group - short-summary: Manage namespaces within an AI Manager. -""" - -helps['aks inference namespace create'] = """ - type: command - short-summary: Create a namespace within an AI Manager. - examples: - - name: Create a namespace - text: az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha - - name: Create a namespace with labels and annotations - text: az aks inference namespace create -m my-ai-manager -g myrg --name team-alpha --labels team=alpha --annotations owner=alice -""" - -helps['aks inference namespace show'] = """ - type: command - short-summary: Show the details of a namespace within an AI Manager. - examples: - - name: Show a namespace - text: az aks inference namespace show -m my-ai-manager -g myrg --name team-alpha -""" - -helps['aks inference namespace delete'] = """ - type: command - short-summary: Delete a namespace within an AI Manager. - examples: - - name: Delete a namespace - text: az aks inference namespace delete -m my-ai-manager -g myrg --name team-alpha -""" - -helps['aks inference namespace list'] = """ - type: command - short-summary: List the namespaces within an AI Manager. - examples: - - name: List namespaces in an AI Manager - text: az aks inference namespace list -m my-ai-manager -g myrg -""" diff --git a/src/aks-preview/azext_aks_preview/aks_inference/commands.py b/src/aks-preview/azext_aks_preview/aks_inference/commands.py deleted file mode 100644 index ad55093fdd2..00000000000 --- a/src/aks-preview/azext_aks_preview/aks_inference/commands.py +++ /dev/null @@ -1,44 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Command registration — the classic equivalent of the wiring in `commands.py:102`. - -This maps CLI commands to the custom functions and the SDK client factory. It is -NOT auto-loaded; to activate, call `load_command_table(self, _)` from the -extension's real `commands.py` and `load_arguments` from `_params.py`. -""" - -from azure.cli.core.commands import CliCommandType -from .custom import ( - aks_inference_create, aks_inference_show, aks_inference_delete, aks_inference_list) -from ._client_factory import cf_ai_managers, cf_ai_manager_namespaces - - -def load_command_table(self, _): - aimanager_custom = CliCommandType( - operations_tmpl='azext_aks_preview.aks_inference.custom#{}', - client_factory=cf_ai_managers, - ) - - with self.command_group('aks inference', aimanager_custom, - custom_command_type=aimanager_custom, - client_factory=cf_ai_managers, is_preview=True) as g: - g.custom_command('create', 'aks_inference_create', supports_no_wait=True) - g.custom_show_command('show', 'aks_inference_show') - g.custom_command('delete', 'aks_inference_delete', supports_no_wait=True, confirmation=True) - g.custom_command('list', 'aks_inference_list') - - namespace_custom = CliCommandType( - operations_tmpl='azext_aks_preview.aks_inference.custom#{}', - client_factory=cf_ai_manager_namespaces, - ) - - with self.command_group('aks inference namespace', namespace_custom, - custom_command_type=namespace_custom, - client_factory=cf_ai_manager_namespaces, is_preview=True) as g: - g.custom_command('create', 'aks_inference_namespace_create', supports_no_wait=True) - g.custom_show_command('show', 'aks_inference_namespace_show') - g.custom_command('delete', 'aks_inference_namespace_delete', - supports_no_wait=True, confirmation=True) - g.custom_command('list', 'aks_inference_namespace_list') diff --git a/src/aks-preview/azext_aks_preview/aks_inference/custom.py b/src/aks-preview/azext_aks_preview/aks_inference/custom.py deleted file mode 100644 index c6c075427dc..00000000000 --- a/src/aks-preview/azext_aks_preview/aks_inference/custom.py +++ /dev/null @@ -1,77 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Custom command implementations — the hand-written equivalent of functions in `custom.py`. - -Compare with the AAZ approach: here YOU build the model, call the SDK method, and -return the (poller) result. LRO/paging come from the SDK, not from generated command files. -""" - -from .vendored_sdk import models - - -def aks_inference_create(cmd, client, resource_group_name, ai_manager_name, location=None, - tags=None, delete_policy=None, no_wait=False): - from azure.cli.core.commands import LongRunningOperation - - parameters = models.AIManager( - location=location, - tags=tags, - properties=models.AIManagerProperties(delete_policy=delete_policy), - ) - poller = client.begin_create_or_update(resource_group_name, ai_manager_name, parameters) - if no_wait: - return poller - return LongRunningOperation(cmd.cli_ctx)(poller) - - -def aks_inference_show(cmd, client, resource_group_name, ai_manager_name): - return client.get(resource_group_name, ai_manager_name) - - -def aks_inference_delete(cmd, client, resource_group_name, ai_manager_name, no_wait=False): - from azure.cli.core.commands import LongRunningOperation - - poller = client.begin_delete(resource_group_name, ai_manager_name) - if no_wait: - return poller - return LongRunningOperation(cmd.cli_ctx)(poller) - - -def aks_inference_list(cmd, client, resource_group_name=None): - if resource_group_name: - return client.list_by_resource_group(resource_group_name) - return client.list_by_subscription() - - -def aks_inference_namespace_create(cmd, client, resource_group_name, ai_manager_name, - namespace_name, labels=None, annotations=None, no_wait=False): - from azure.cli.core.commands import LongRunningOperation - - parameters = models.AIManagerNamespace( - properties=models.AIManagerNamespaceProperties(labels=labels, annotations=annotations), - ) - poller = client.begin_create_or_update( - resource_group_name, ai_manager_name, namespace_name, parameters) - if no_wait: - return poller - return LongRunningOperation(cmd.cli_ctx)(poller) - - -def aks_inference_namespace_show(cmd, client, resource_group_name, ai_manager_name, namespace_name): - return client.get(resource_group_name, ai_manager_name, namespace_name) - - -def aks_inference_namespace_delete(cmd, client, resource_group_name, ai_manager_name, - namespace_name, no_wait=False): - from azure.cli.core.commands import LongRunningOperation - - poller = client.begin_delete(resource_group_name, ai_manager_name, namespace_name) - if no_wait: - return poller - return LongRunningOperation(cmd.cli_ctx)(poller) - - -def aks_inference_namespace_list(cmd, client, resource_group_name, ai_manager_name): - return client.list_by_ai_manager(resource_group_name, ai_manager_name) diff --git a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py deleted file mode 100644 index 608502c4fd7..00000000000 --- a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/_client.py +++ /dev/null @@ -1,233 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Illustrative track2-style client + operations for the AIManager resource. - -Mirrors what AutoRest generates: an ``ARMPipelineClient`` plus an operations -group whose methods build requests, send them through the pipeline, and (for -PUT/DELETE) return an ``LROPoller``. Condensed and hand-written for comparison -with the AAZ approach only. -""" - -from azure.mgmt.core import ARMPipelineClient -from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy -from azure.core.polling import LROPoller -from azure.mgmt.core.polling.arm_polling import ARMPolling -from azure.core.pipeline.transport import HttpRequest -from msrest import Serializer, Deserializer - -from . import models as _models - -API_VERSION = "2026-04-02-preview" - - -class AIManagersOperations: - """Operations for Microsoft.ContainerService/aiManagers.""" - - def __init__(self, client, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - def _url(self, template, **kwargs): - path_args = {k: self._serialize.url(k, v, "str") for k, v in kwargs.items()} - return self._client.format_url(template, **path_args) - - def _query(self): - return {"api-version": self._serialize.query("api_version", API_VERSION, "str")} - - def _headers(self, has_body): - headers = {"Accept": "application/json"} - if has_body: - headers["Content-Type"] = "application/json" - return headers - - def begin_create_or_update(self, resource_group_name, ai_manager_name, parameters, **kwargs): - url = self._url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" - "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - ) - body = self._serialize.body(parameters, "AIManager") - request = HttpRequest("PUT", url, headers=self._headers(True)) - request.format_parameters(self._query()) - request.set_json_body(body) - - def deserialization_callback(pipeline_response): - return self._deserialize("AIManager", pipeline_response.http_response) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - return LROPoller( - self._client, pipeline_response, deserialization_callback, ARMPolling(30, **kwargs) - ) - - def get(self, resource_group_name, ai_manager_name, **kwargs): - url = self._url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" - "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - ) - request = HttpRequest("GET", url, headers=self._headers(False)) - request.format_parameters(self._query()) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - return self._deserialize("AIManager", pipeline_response.http_response) - - def begin_delete(self, resource_group_name, ai_manager_name, **kwargs): - url = self._url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" - "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - ) - request = HttpRequest("DELETE", url, headers=self._headers(False)) - request.format_parameters(self._query()) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - return LROPoller(self._client, pipeline_response, lambda _: None, ARMPolling(30, **kwargs)) - - def list_by_resource_group(self, resource_group_name, **kwargs): - url = self._url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" - "/providers/Microsoft.ContainerService/aiManagers", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - ) - return self._list(url, **kwargs) - - def list_by_subscription(self, **kwargs): - url = self._url( - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/aiManagers", - subscriptionId=self._client._subscription_id, - ) - return self._list(url, **kwargs) - - def _list(self, url, **kwargs): - request = HttpRequest("GET", url, headers=self._headers(False)) - request.format_parameters(self._query()) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - body = self._deserialize.dependencies["object"](pipeline_response.http_response.text()) - return [self._deserialize("AIManager", item) for item in (body or {}).get("value", [])] - - -class AIManagerNamespacesOperations: - """Operations for Microsoft.ContainerService/aiManagers/namespaces.""" - - _BASE = ("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" - "/providers/Microsoft.ContainerService/aiManagers/{aiManagerName}/namespaces") - - def __init__(self, client, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - def _url(self, template, **kwargs): - path_args = {k: self._serialize.url(k, v, "str") for k, v in kwargs.items()} - return self._client.format_url(template, **path_args) - - def _query(self): - return {"api-version": self._serialize.query("api_version", API_VERSION, "str")} - - def _headers(self, has_body): - headers = {"Accept": "application/json"} - if has_body: - headers["Content-Type"] = "application/json" - return headers - - def begin_create_or_update(self, resource_group_name, ai_manager_name, namespace_name, - parameters, **kwargs): - url = self._url( - self._BASE + "/{namespaceName}", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - namespaceName=namespace_name, - ) - body = self._serialize.body(parameters, "AIManagerNamespace") - request = HttpRequest("PUT", url, headers=self._headers(True)) - request.format_parameters(self._query()) - request.set_json_body(body) - - def deserialization_callback(pipeline_response): - return self._deserialize("AIManagerNamespace", pipeline_response.http_response) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - return LROPoller( - self._client, pipeline_response, deserialization_callback, ARMPolling(30, **kwargs) - ) - - def get(self, resource_group_name, ai_manager_name, namespace_name, **kwargs): - url = self._url( - self._BASE + "/{namespaceName}", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - namespaceName=namespace_name, - ) - request = HttpRequest("GET", url, headers=self._headers(False)) - request.format_parameters(self._query()) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - return self._deserialize("AIManagerNamespace", pipeline_response.http_response) - - def begin_delete(self, resource_group_name, ai_manager_name, namespace_name, **kwargs): - url = self._url( - self._BASE + "/{namespaceName}", - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - namespaceName=namespace_name, - ) - request = HttpRequest("DELETE", url, headers=self._headers(False)) - request.format_parameters(self._query()) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - return LROPoller(self._client, pipeline_response, lambda _: None, ARMPolling(30, **kwargs)) - - def list_by_ai_manager(self, resource_group_name, ai_manager_name, **kwargs): - url = self._url( - self._BASE, - subscriptionId=self._client._subscription_id, - resourceGroupName=resource_group_name, - aiManagerName=ai_manager_name, - ) - request = HttpRequest("GET", url, headers=self._headers(False)) - request.format_parameters(self._query()) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - body = self._deserialize.dependencies["object"](pipeline_response.http_response.text()) - return [self._deserialize("AIManagerNamespace", item) - for item in (body or {}).get("value", [])] - - -class AIManagerMgmtClient: - """Illustrative management client (what AutoRest calls e.g. ContainerServiceAIManagerClient).""" - - def __init__(self, credential, subscription_id, base_url, credential_scopes=None, **kwargs): - self._subscription_id = subscription_id - policies = kwargs.pop("policies", None) - if policies is None: - policies = [ARMAutoResourceProviderRegistrationPolicy()] - self._pipeline_client = ARMPipelineClient( - base_url=base_url, - credential=credential, - credential_scopes=credential_scopes or [base_url.rstrip("/") + "/.default"], - per_call_policies=policies, - **kwargs, - ) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - self.ai_managers = AIManagersOperations(self, self._serialize, self._deserialize) - self.ai_manager_namespaces = AIManagerNamespacesOperations( - self, self._serialize, self._deserialize) - - # convenience shims so operations can use `self._client.<...>` - @property - def _pipeline(self): - return self._pipeline_client._pipeline - - def format_url(self, template, **kwargs): - return self._pipeline_client.format_url(template, **kwargs) diff --git a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py b/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py deleted file mode 100644 index 76e757138ed..00000000000 --- a/src/aks-preview/azext_aks_preview/aks_inference/vendored_sdk/models.py +++ /dev/null @@ -1,94 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Illustrative track2-style models for the AIManager resource. - -In a real extension these would be generated by AutoRest from the Swagger and -placed under ``vendored_sdks/``. They are hand-written here, condensed, only to -demonstrate the classic (non-AAZ) command pattern. -""" - -from msrest.serialization import Model - - -class ManagedServiceIdentity(Model): - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{object}"}, - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - } - - def __init__(self, *, type=None, user_assigned_identities=None, **kwargs): - super().__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities - self.principal_id = None - self.tenant_id = None - - -class AIManagerProperties(Model): - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "delete_policy": {"key": "deletePolicy", "type": "str"}, - "managed_resource_group_name": {"key": "managedResourceGroupName", "type": "str"}, - } - - def __init__(self, *, delete_policy=None, **kwargs): - super().__init__(**kwargs) - self.provisioning_state = None - self.delete_policy = delete_policy - self.managed_resource_group_name = None - - -class AIManager(Model): - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "properties": {"key": "properties", "type": "AIManagerProperties"}, - } - - def __init__(self, *, location=None, tags=None, identity=None, properties=None, **kwargs): - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.identity = identity - self.properties = properties - - -class AIManagerNamespaceProperties(Model): - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "labels": {"key": "labels", "type": "{str}"}, - "annotations": {"key": "annotations", "type": "{str}"}, - } - - def __init__(self, *, labels=None, annotations=None, **kwargs): - super().__init__(**kwargs) - self.provisioning_state = None - self.labels = labels - self.annotations = annotations - - -class AIManagerNamespace(Model): - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "AIManagerNamespaceProperties"}, - } - - def __init__(self, *, properties=None, **kwargs): - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.properties = properties diff --git a/src/aks-preview/azext_aks_preview/commands.py b/src/aks-preview/azext_aks_preview/commands.py index b07b3b15df0..2283156497e 100644 --- a/src/aks-preview/azext_aks_preview/commands.py +++ b/src/aks-preview/azext_aks_preview/commands.py @@ -629,6 +629,6 @@ def load_command_table(self, _): self.command_table["aks safeguards list"] = List(loader=self) self.command_table["aks safeguards wait"] = Wait(loader=self) - # AKS inference (AI Manager) commands - classic vendored-SDK approach - from .aks_inference.commands import load_command_table as _load_aks_inference_commands - _load_aks_inference_commands(self, _) + # AI Manager (az aimanager) commands - vendored-SDK approach + from .aimanager.commands import load_command_table as _load_aimanager_commands + _load_aimanager_commands(self, _) From 9fb5ffcb649ccfe14d44340ffb089008a6e51428 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Wed, 5 Aug 2026 21:05:52 +0000 Subject: [PATCH 04/11] Restructure az aimanager to match managed namespace format Register the vendored containerserviceaimanager SDK as a CustomResourceType and resolve models via cmd.get_models. Anchor command groups on the SDK operations classes, add a construct/update builder module (aimanager.py), and make the custom handlers do existence checks, raw_parameters snapshots, custom headers and sdk_no_wait - mirroring the aks namespace (managed namespace) structure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/aks-preview/azext_aks_preview/__init__.py | 6 + .../aimanager/_client_factory.py | 21 +- .../azext_aks_preview/aimanager/_help.py | 2 + .../azext_aks_preview/aimanager/_params.py | 20 +- .../azext_aks_preview/aimanager/aimanager.py | 183 +++++++++++++++ .../azext_aks_preview/aimanager/commands.py | 33 +-- .../azext_aks_preview/aimanager/custom.py | 220 +++++++++++++----- 7 files changed, 392 insertions(+), 93 deletions(-) create mode 100644 src/aks-preview/azext_aks_preview/aimanager/aimanager.py diff --git a/src/aks-preview/azext_aks_preview/__init__.py b/src/aks-preview/azext_aks_preview/__init__.py index e0074aaf43f..6f4dfd3cdf7 100644 --- a/src/aks-preview/azext_aks_preview/__init__.py +++ b/src/aks-preview/azext_aks_preview/__init__.py @@ -10,6 +10,7 @@ # pylint: disable=unused-import import azext_aks_preview._help from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW +from azext_aks_preview.aimanager._client_factory import CUSTOM_MGMT_AIMANAGER def register_aks_preview_resource_type(): @@ -18,6 +19,11 @@ def register_aks_preview_resource_type(): CUSTOM_MGMT_AKS_PREVIEW, None, ) + register_resource_type( + "latest", + CUSTOM_MGMT_AIMANAGER, + None, + ) class ContainerServiceCommandsLoader(AzCommandsLoader): diff --git a/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py b/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py index abb4490b72d..524ee57a466 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py +++ b/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py @@ -2,25 +2,28 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -"""Client factory for the AI Manager commands. +"""Client factory for the ``az aimanager`` command group. -Wires up the vendored ``azure-mgmt-containerserviceaimanager`` track2 client through -``get_mgmt_service_client`` (credential, subscription id, ARM endpoint and scopes) and -exposes the individual operation groups used by the custom commands. +The vendored ``azure-mgmt-containerserviceaimanager`` SDK is registered as a custom +resource type so models can be resolved via ``cmd.get_models`` (see ``aimanager.py``), +mirroring how ``managed_namespaces`` uses ``CUSTOM_MGMT_AKS_PREVIEW``. """ from azure.cli.core.commands.client_factory import get_mgmt_service_client +from azure.cli.core.profiles import CustomResourceType -from .vendored_sdk import ContainerServiceAIManagerMgmtClient +CUSTOM_MGMT_AIMANAGER = CustomResourceType( + 'azext_aks_preview.aimanager.vendored_sdk', + 'ContainerServiceAIManagerMgmtClient') -def cf_aimanager_client(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, ContainerServiceAIManagerMgmtClient) +def get_aimanager_client(cli_ctx, subscription_id=None): + return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AIMANAGER, subscription_id=subscription_id) def cf_ai_managers(cli_ctx, *_): - return cf_aimanager_client(cli_ctx).ai_managers + return get_aimanager_client(cli_ctx).ai_managers def cf_ai_manager_namespaces(cli_ctx, *_): - return cf_aimanager_client(cli_ctx).ai_manager_namespaces + return get_aimanager_client(cli_ctx).ai_manager_namespaces diff --git a/src/aks-preview/azext_aks_preview/aimanager/_help.py b/src/aks-preview/azext_aks_preview/aimanager/_help.py index b084f3247d2..75814a51257 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/_help.py +++ b/src/aks-preview/azext_aks_preview/aimanager/_help.py @@ -31,6 +31,8 @@ examples: - name: Update the tags of an AI Manager text: az aimanager update --name my-ai-manager -g myrg --tags env=prod team=alpha + - name: Update the delete policy of an AI Manager + text: az aimanager update --name my-ai-manager -g myrg --delete-policy Keep """ helps['aimanager show'] = """ diff --git a/src/aks-preview/azext_aks_preview/aimanager/_params.py b/src/aks-preview/azext_aks_preview/aimanager/_params.py index 3444da3595b..da237789f6b 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/_params.py +++ b/src/aks-preview/azext_aks_preview/aimanager/_params.py @@ -14,14 +14,16 @@ def load_arguments(self, _): help='The name of the AI Manager resource.', completer=get_resource_name_completion_list('Microsoft.ContainerService/aiManagers')) + for scope in ['aimanager create', 'aimanager update']: + with self.argument_context(scope) as c: + c.argument('tags', arg_type=tags_type, help='The tags to set to the AI Manager.') + c.argument('delete_policy', arg_type=get_enum_type(['Keep', 'Delete']), + help="Delete options of the AI Manager. Defaults to Delete.") + c.argument('aks_custom_headers') + c.argument('no_wait', help='Do not wait for the long-running operation to finish.') + with self.argument_context('aimanager create') as c: c.argument('location', arg_type=get_location_type(self.cli_ctx)) - c.argument('tags', arg_type=tags_type) - c.argument('delete_policy', arg_type=get_enum_type(['Keep', 'Delete']), - help="Delete options of the AI Manager. Defaults to Delete.") - - with self.argument_context('aimanager update') as c: - c.argument('tags', arg_type=tags_type) with self.argument_context('aimanager list') as c: c.ignore('ai_manager_name') @@ -34,6 +36,8 @@ def load_arguments(self, _): for scope in ['aimanager namespace add', 'aimanager namespace update']: with self.argument_context(scope) as c: - c.argument('labels', tags_type, help='Labels applied to the Kubernetes namespace.') - c.argument('annotations', tags_type, + c.argument('labels', nargs='*', help='Labels applied to the Kubernetes namespace.') + c.argument('annotations', nargs='*', help='Annotations applied to the Kubernetes namespace.') + c.argument('aks_custom_headers') + c.argument('no_wait', help='Do not wait for the long-running operation to finish.') diff --git a/src/aks-preview/azext_aks_preview/aimanager/aimanager.py b/src/aks-preview/azext_aks_preview/aimanager/aimanager.py new file mode 100644 index 00000000000..e27d8fe0c16 --- /dev/null +++ b/src/aks-preview/azext_aks_preview/aimanager/aimanager.py @@ -0,0 +1,183 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Model builders and SDK invocations for the ``az aimanager`` command group. + +Mirrors the ``managednamespace.py`` structure: command handlers in ``custom.py`` gather the +raw parameters and delegate here, where the models are resolved through +``cmd.get_models`` (the vendored SDK registered as ``CUSTOM_MGMT_AIMANAGER``) and the +operation-group methods are called through ``sdk_no_wait``. +""" + +from azure.cli.core.util import sdk_no_wait + +from ._client_factory import CUSTOM_MGMT_AIMANAGER + + +def parse_key_value_list(pairs): + result = {} + if pairs is None: + return result + for pair in pairs: + if "=" not in pair: + raise ValueError(f"Invalid format '{pair}'. Expected format key=value.") + key, value = pair.split("=", 1) + result[key.strip()] = value.strip() + return result + + +def _get_model(cmd, name, operation_group): + return cmd.get_models( + name, + resource_type=CUSTOM_MGMT_AIMANAGER, + operation_group=operation_group, + ) + + +# region AI Manager + +def constructAIManager(cmd, raw_parameters): + location = raw_parameters.get("location") + tags = raw_parameters.get("tags") + delete_policy = raw_parameters.get("delete_policy") + + AIManagerProperties = _get_model(cmd, "AIManagerProperties", "ai_managers") + AIManager = _get_model(cmd, "AIManager", "ai_managers") + + ai_manager = AIManager() + ai_manager.location = location + ai_manager.tags = tags + ai_manager.properties = AIManagerProperties(delete_policy=delete_policy) + return ai_manager + + +def updateAIManager(cmd, raw_parameters, existedAIManager): + tags = raw_parameters.get("tags") + delete_policy = raw_parameters.get("delete_policy") + + if tags is None: + tags = existedAIManager.tags + + existing_properties = existedAIManager.properties + if delete_policy is None and existing_properties is not None: + delete_policy = existing_properties.delete_policy + + AIManagerProperties = _get_model(cmd, "AIManagerProperties", "ai_managers") + AIManager = _get_model(cmd, "AIManager", "ai_managers") + + ai_manager = AIManager() + ai_manager.location = existedAIManager.location + ai_manager.tags = tags + ai_manager.properties = AIManagerProperties(delete_policy=delete_policy) + return ai_manager + + +def aks_aimanager_create(cmd, client, raw_parameters, headers, no_wait): + resource_group_name = raw_parameters.get("resource_group_name") + ai_manager_name = raw_parameters.get("ai_manager_name") + + ai_manager = constructAIManager(cmd, raw_parameters) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + ai_manager, + headers=headers, + ) + + +def aks_aimanager_update(cmd, client, raw_parameters, headers, existedAIManager, no_wait): + resource_group_name = raw_parameters.get("resource_group_name") + ai_manager_name = raw_parameters.get("ai_manager_name") + + ai_manager = updateAIManager(cmd, raw_parameters, existedAIManager) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + ai_manager, + headers=headers, + ) + +# endregion + + +# region AI Manager namespace + +def constructNamespace(cmd, raw_parameters): + labels = parse_key_value_list(raw_parameters.get("labels")) + annotations = parse_key_value_list(raw_parameters.get("annotations")) + + NamespaceProperties = _get_model(cmd, "AIManagerNamespaceProperties", "ai_manager_namespaces") + Namespace = _get_model(cmd, "AIManagerNamespace", "ai_manager_namespaces") + + namespace_config = Namespace() + namespace_config.properties = NamespaceProperties(labels=labels, annotations=annotations) + return namespace_config + + +def updateNamespace(cmd, raw_parameters, existedNamespace): + labels_raw = raw_parameters.get("labels") + annotations_raw = raw_parameters.get("annotations") + + existing_properties = existedNamespace.properties + + if labels_raw is None: + labels = existing_properties.labels if existing_properties is not None else None + else: + labels = parse_key_value_list(labels_raw) + + if annotations_raw is None: + annotations = existing_properties.annotations if existing_properties is not None else None + else: + annotations = parse_key_value_list(annotations_raw) + + NamespaceProperties = _get_model(cmd, "AIManagerNamespaceProperties", "ai_manager_namespaces") + Namespace = _get_model(cmd, "AIManagerNamespace", "ai_manager_namespaces") + + namespace_config = Namespace() + namespace_config.properties = NamespaceProperties(labels=labels, annotations=annotations) + return namespace_config + + +def aks_aimanager_namespace_add(cmd, client, raw_parameters, headers, no_wait): + resource_group_name = raw_parameters.get("resource_group_name") + ai_manager_name = raw_parameters.get("ai_manager_name") + namespace_name = raw_parameters.get("namespace_name") + + namespace_config = constructNamespace(cmd, raw_parameters) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + namespace_name, + namespace_config, + headers=headers, + ) + + +def aks_aimanager_namespace_update(cmd, client, raw_parameters, headers, existedNamespace, no_wait): + resource_group_name = raw_parameters.get("resource_group_name") + ai_manager_name = raw_parameters.get("ai_manager_name") + namespace_name = raw_parameters.get("namespace_name") + + namespace_config = updateNamespace(cmd, raw_parameters, existedNamespace) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + namespace_name, + namespace_config, + headers=headers, + ) + +# endregion diff --git a/src/aks-preview/azext_aks_preview/aimanager/commands.py b/src/aks-preview/azext_aks_preview/aimanager/commands.py index aa9f5b3eb56..0b53a53f432 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/commands.py +++ b/src/aks-preview/azext_aks_preview/aimanager/commands.py @@ -4,8 +4,9 @@ # -------------------------------------------------------------------------------------------- """Command registration for the ``az aimanager`` command group. -This module is not auto-loaded; ``load_command_table`` is invoked from the extension's -top-level ``commands.py``. +Mirrors the ``aks namespace`` registration: each command group is anchored on the vendored +SDK operations class, while the individual commands are wired to the custom handlers. +This module is loaded from the extension's top-level ``commands.py``. """ from azure.cli.core.commands import CliCommandType @@ -16,29 +17,35 @@ def load_command_table(self, _): aimanager_custom = CliCommandType( operations_tmpl='azext_aks_preview.aimanager.custom#{}', + ) + + ai_managers_sdk = CliCommandType( + operations_tmpl='azext_aks_preview.aimanager.vendored_sdk.operations.' + '_operations#AIManagersOperations.{}', client_factory=cf_ai_managers, ) - with self.command_group('aimanager', aimanager_custom, + ai_manager_namespaces_sdk = CliCommandType( + operations_tmpl='azext_aks_preview.aimanager.vendored_sdk.operations.' + '_operations#AIManagerNamespacesOperations.{}', + client_factory=cf_ai_manager_namespaces, + ) + + with self.command_group('aimanager', ai_managers_sdk, custom_command_type=aimanager_custom, client_factory=cf_ai_managers, is_preview=True) as g: g.custom_command('create', 'aimanager_create', supports_no_wait=True) - g.custom_command('update', 'aimanager_update') + g.custom_command('update', 'aimanager_update', supports_no_wait=True) g.custom_show_command('show', 'aimanager_show') - g.custom_command('delete', 'aimanager_delete', supports_no_wait=True, confirmation=True) g.custom_command('list', 'aimanager_list') + g.custom_command('delete', 'aimanager_delete', supports_no_wait=True, confirmation=True) - namespace_custom = CliCommandType( - operations_tmpl='azext_aks_preview.aimanager.custom#{}', - client_factory=cf_ai_manager_namespaces, - ) - - with self.command_group('aimanager namespace', namespace_custom, - custom_command_type=namespace_custom, + with self.command_group('aimanager namespace', ai_manager_namespaces_sdk, + custom_command_type=aimanager_custom, client_factory=cf_ai_manager_namespaces, is_preview=True) as g: g.custom_command('add', 'aimanager_namespace_add', supports_no_wait=True) g.custom_command('update', 'aimanager_namespace_update', supports_no_wait=True) g.custom_show_command('show', 'aimanager_namespace_show') + g.custom_command('list', 'aimanager_namespace_list') g.custom_command('delete', 'aimanager_namespace_delete', supports_no_wait=True, confirmation=True) - g.custom_command('list', 'aimanager_namespace_list') diff --git a/src/aks-preview/azext_aks_preview/aimanager/custom.py b/src/aks-preview/azext_aks_preview/aimanager/custom.py index 19caa39a1d9..6a480e1ef7a 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/custom.py +++ b/src/aks-preview/azext_aks_preview/aimanager/custom.py @@ -2,95 +2,189 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -"""Custom command implementations for the AI Manager commands. +"""Command handlers for the ``az aimanager`` command group. -These build the vendored SDK models, call the operation-group methods and return the -result (or the poller when ``--no-wait`` is passed). +These mirror the ``aks namespace`` (managed namespace) structure: each mutating handler +performs an existence check with a friendly error, snapshots the raw parameters via +``locals()`` and delegates model construction / SDK calls to ``aimanager.py``. """ -from azure.cli.core.commands import LongRunningOperation +from azure.cli.core.azclierror import ClientRequestError +from azure.core.exceptions import ResourceNotFoundError -from .vendored_sdk import models +from .aimanager import ( + aks_aimanager_create, + aks_aimanager_update, + aks_aimanager_namespace_add, + aks_aimanager_namespace_update, +) -def _wait(cmd, poller, no_wait): - if no_wait: - return poller - return LongRunningOperation(cmd.cli_ctx)(poller) +def _get_custom_headers(aks_custom_headers): + from azext_aks_preview.custom import get_aks_custom_headers + return get_aks_custom_headers(aks_custom_headers) # region AI Manager -def aimanager_create(cmd, client, resource_group_name, ai_manager_name, location=None, - tags=None, delete_policy=None, no_wait=False): - resource = models.AIManager( - location=location, - tags=tags, - properties=models.AIManagerProperties(delete_policy=delete_policy), - ) - poller = client.begin_create_or_update(resource_group_name, ai_manager_name, resource) - return _wait(cmd, poller, no_wait) - - -def aimanager_update(cmd, client, resource_group_name, ai_manager_name, tags=None): - properties = models.AIManagerPatch(tags=tags) - return client.update(resource_group_name, ai_manager_name, properties) - - -def aimanager_show(cmd, client, resource_group_name, ai_manager_name): +# pylint: disable=unused-argument +def aimanager_create( + cmd, + client, + resource_group_name, + ai_manager_name, + location=None, + tags=None, + delete_policy=None, + aks_custom_headers=None, + no_wait=False, +): + existedAIManager = None + try: + existedAIManager = client.get(resource_group_name, ai_manager_name) + except ResourceNotFoundError: + pass + + if existedAIManager: + raise ClientRequestError( + f"AI Manager '{ai_manager_name}' already exists. " + "Please use 'az aimanager update' to update it." + ) + + # DO NOT MOVE: get all the original parameters and save them as a dictionary + raw_parameters = locals() + headers = _get_custom_headers(aks_custom_headers) + return aks_aimanager_create(cmd, client, raw_parameters, headers, no_wait) + + +# pylint: disable=unused-argument +def aimanager_update( + cmd, + client, + resource_group_name, + ai_manager_name, + tags=None, + delete_policy=None, + aks_custom_headers=None, + no_wait=False, +): + try: + existedAIManager = client.get(resource_group_name, ai_manager_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"AI Manager '{ai_manager_name}' doesn't exist. " + "Please use 'az aimanager list' to get the current list of AI Managers." + ) + + # DO NOT MOVE: get all the original parameters and save them as a dictionary + raw_parameters = locals() + headers = _get_custom_headers(aks_custom_headers) + return aks_aimanager_update(cmd, client, raw_parameters, headers, existedAIManager, no_wait) + + +def aimanager_show(cmd, client, resource_group_name, ai_manager_name): # pylint: disable=unused-argument return client.get(resource_group_name, ai_manager_name) -def aimanager_delete(cmd, client, resource_group_name, ai_manager_name, no_wait=False): - poller = client.begin_delete(resource_group_name, ai_manager_name) - return _wait(cmd, poller, no_wait) - - -def aimanager_list(cmd, client, resource_group_name=None): +def aimanager_list(cmd, client, resource_group_name=None): # pylint: disable=unused-argument if resource_group_name: return client.list_by_resource_group(resource_group_name) return client.list_by_subscription() + +def aimanager_delete(cmd, client, resource_group_name, ai_manager_name, no_wait=False): # pylint: disable=unused-argument + from azure.cli.core.util import sdk_no_wait + + try: + client.get(resource_group_name, ai_manager_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"AI Manager '{ai_manager_name}' doesn't exist. " + "Please use 'az aimanager list' to get the current list of AI Managers." + ) + + return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, ai_manager_name) + # endregion # region AI Manager namespace -def aimanager_namespace_add(cmd, client, resource_group_name, ai_manager_name, namespace_name, - labels=None, annotations=None, no_wait=False): - resource = models.AIManagerNamespace( - properties=models.AIManagerNamespaceProperties(labels=labels, annotations=annotations), - ) - poller = client.begin_create_or_update( - resource_group_name, ai_manager_name, namespace_name, resource) - return _wait(cmd, poller, no_wait) - - -def aimanager_namespace_update(cmd, client, resource_group_name, ai_manager_name, namespace_name, - labels=None, annotations=None, no_wait=False): - existing = client.get(resource_group_name, ai_manager_name, namespace_name) - properties = existing.properties or models.AIManagerNamespaceProperties() - if labels is not None: - properties.labels = labels - if annotations is not None: - properties.annotations = annotations - resource = models.AIManagerNamespace(properties=properties) - poller = client.begin_create_or_update( - resource_group_name, ai_manager_name, namespace_name, resource) - return _wait(cmd, poller, no_wait) - - -def aimanager_namespace_show(cmd, client, resource_group_name, ai_manager_name, namespace_name): +# pylint: disable=unused-argument +def aimanager_namespace_add( + cmd, + client, + resource_group_name, + ai_manager_name, + namespace_name, + labels=None, + annotations=None, + aks_custom_headers=None, + no_wait=False, +): + existedNamespace = None + try: + existedNamespace = client.get(resource_group_name, ai_manager_name, namespace_name) + except ResourceNotFoundError: + pass + + if existedNamespace: + raise ClientRequestError( + f"Namespace '{namespace_name}' already exists. " + "Please use 'az aimanager namespace update' to update it." + ) + + # DO NOT MOVE: get all the original parameters and save them as a dictionary + raw_parameters = locals() + headers = _get_custom_headers(aks_custom_headers) + return aks_aimanager_namespace_add(cmd, client, raw_parameters, headers, no_wait) + + +# pylint: disable=unused-argument +def aimanager_namespace_update( + cmd, + client, + resource_group_name, + ai_manager_name, + namespace_name, + labels=None, + annotations=None, + aks_custom_headers=None, + no_wait=False, +): + try: + existedNamespace = client.get(resource_group_name, ai_manager_name, namespace_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"Namespace '{namespace_name}' doesn't exist. " + "Please use 'az aimanager namespace list' to get the current list of namespaces." + ) + + # DO NOT MOVE: get all the original parameters and save them as a dictionary + raw_parameters = locals() + headers = _get_custom_headers(aks_custom_headers) + return aks_aimanager_namespace_update(cmd, client, raw_parameters, headers, existedNamespace, no_wait) + + +def aimanager_namespace_show(cmd, client, resource_group_name, ai_manager_name, namespace_name): # pylint: disable=unused-argument return client.get(resource_group_name, ai_manager_name, namespace_name) -def aimanager_namespace_delete(cmd, client, resource_group_name, ai_manager_name, - namespace_name, no_wait=False): - poller = client.begin_delete(resource_group_name, ai_manager_name, namespace_name) - return _wait(cmd, poller, no_wait) +def aimanager_namespace_list(cmd, client, resource_group_name, ai_manager_name): # pylint: disable=unused-argument + return client.list_by_ai_manager(resource_group_name, ai_manager_name) -def aimanager_namespace_list(cmd, client, resource_group_name, ai_manager_name): - return client.list_by_ai_manager(resource_group_name, ai_manager_name) +def aimanager_namespace_delete(cmd, client, resource_group_name, ai_manager_name, namespace_name, no_wait=False): # pylint: disable=unused-argument + from azure.cli.core.util import sdk_no_wait + + try: + client.get(resource_group_name, ai_manager_name, namespace_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"Namespace '{namespace_name}' doesn't exist. " + "Please use 'az aimanager namespace list' to get the current list of namespaces." + ) + + return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, ai_manager_name, namespace_name) # endregion From ce9c804c91bb0a80e6bdd7f27d82788bc1756b16 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Wed, 5 Aug 2026 21:38:29 +0000 Subject: [PATCH 05/11] Extract aimanager into standalone src/aimanager extension Move the `az aimanager` command group out of aks-preview into a new standalone extension at src/aimanager, mirroring the src/fleet structure: loader, _client_factory, commands, custom, _params, _help, _helpers, _validators, constants, packaging files, and a tests scaffold. The vendored azure-mgmt-containerserviceaimanager (typespec) SDK is moved to azext_aimanager/vendored_sdks and registered with api_version=None. Remove the aimanager code and wiring from aks-preview and revert its HISTORY.rst entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/aimanager/HISTORY.rst | 11 + src/aimanager/README.rst | 5 + src/aimanager/azext_aimanager/__init__.py | 47 ++++ .../azext_aimanager}/_client_factory.py | 8 +- .../azext_aimanager}/_help.py | 17 +- src/aimanager/azext_aimanager/_helpers.py | 32 +++ .../azext_aimanager}/_params.py | 38 ++- src/aimanager/azext_aimanager/_validators.py | 33 +++ .../azext_aimanager/azext_metadata.json | 5 + src/aimanager/azext_aimanager/commands.py | 44 ++++ src/aimanager/azext_aimanager/constants.py | 9 + src/aimanager/azext_aimanager/custom.py | 231 ++++++++++++++++++ .../azext_aimanager/tests}/__init__.py | 7 +- .../azext_aimanager/tests/latest/__init__.py | 5 + .../tests/latest/test_aimanager_helpers.py | 42 ++++ .../vendored_sdks}/__init__.py | 0 .../azext_aimanager/vendored_sdks}/_client.py | 0 .../vendored_sdks}/_configuration.py | 0 .../azext_aimanager/vendored_sdks}/_patch.py | 0 .../vendored_sdks}/_utils/__init__.py | 0 .../vendored_sdks}/_utils/model_base.py | 0 .../vendored_sdks}/_utils/serialization.py | 0 .../vendored_sdks}/_utils/utils.py | 0 .../vendored_sdks}/_validation.py | 0 .../vendored_sdks}/_version.py | 0 .../vendored_sdks}/aio/__init__.py | 0 .../vendored_sdks}/aio/_client.py | 0 .../vendored_sdks}/aio/_configuration.py | 0 .../vendored_sdks}/aio/_patch.py | 0 .../vendored_sdks}/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 0 .../vendored_sdks}/aio/operations/_patch.py | 0 .../vendored_sdks}/models/__init__.py | 0 .../vendored_sdks}/models/_enums.py | 0 .../vendored_sdks}/models/_models.py | 0 .../vendored_sdks}/models/_patch.py | 0 .../vendored_sdks}/operations/__init__.py | 0 .../vendored_sdks}/operations/_operations.py | 0 .../vendored_sdks}/operations/_patch.py | 0 .../azext_aimanager/vendored_sdks}/py.typed | 0 .../azext_aimanager/vendored_sdks}/types.py | 0 src/aimanager/setup.cfg | 0 src/aimanager/setup.py | 53 ++++ src/aks-preview/HISTORY.rst | 1 - src/aks-preview/azext_aks_preview/__init__.py | 6 - src/aks-preview/azext_aks_preview/_help.py | 3 - src/aks-preview/azext_aks_preview/_params.py | 4 - .../azext_aks_preview/aimanager/aimanager.py | 183 -------------- .../azext_aks_preview/aimanager/commands.py | 51 ---- .../azext_aks_preview/aimanager/custom.py | 190 -------------- src/aks-preview/azext_aks_preview/commands.py | 4 - 51 files changed, 560 insertions(+), 469 deletions(-) create mode 100644 src/aimanager/HISTORY.rst create mode 100644 src/aimanager/README.rst create mode 100644 src/aimanager/azext_aimanager/__init__.py rename src/{aks-preview/azext_aks_preview/aimanager => aimanager/azext_aimanager}/_client_factory.py (72%) rename src/{aks-preview/azext_aks_preview/aimanager => aimanager/azext_aimanager}/_help.py (91%) create mode 100644 src/aimanager/azext_aimanager/_helpers.py rename src/{aks-preview/azext_aks_preview/aimanager => aimanager/azext_aimanager}/_params.py (53%) create mode 100644 src/aimanager/azext_aimanager/_validators.py create mode 100644 src/aimanager/azext_aimanager/azext_metadata.json create mode 100644 src/aimanager/azext_aimanager/commands.py create mode 100644 src/aimanager/azext_aimanager/constants.py create mode 100644 src/aimanager/azext_aimanager/custom.py rename src/{aks-preview/azext_aks_preview/aimanager => aimanager/azext_aimanager/tests}/__init__.py (73%) create mode 100644 src/aimanager/azext_aimanager/tests/latest/__init__.py create mode 100644 src/aimanager/azext_aimanager/tests/latest/test_aimanager_helpers.py rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/__init__.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_client.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_configuration.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_patch.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_utils/__init__.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_utils/model_base.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_utils/serialization.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_utils/utils.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_validation.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/_version.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/__init__.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/_client.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/_configuration.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/_patch.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/operations/__init__.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/operations/_operations.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/aio/operations/_patch.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/models/__init__.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/models/_enums.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/models/_models.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/models/_patch.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/operations/__init__.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/operations/_operations.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/operations/_patch.py (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/py.typed (100%) rename src/{aks-preview/azext_aks_preview/aimanager/vendored_sdk => aimanager/azext_aimanager/vendored_sdks}/types.py (100%) create mode 100644 src/aimanager/setup.cfg create mode 100644 src/aimanager/setup.py delete mode 100644 src/aks-preview/azext_aks_preview/aimanager/aimanager.py delete mode 100644 src/aks-preview/azext_aks_preview/aimanager/commands.py delete mode 100644 src/aks-preview/azext_aks_preview/aimanager/custom.py diff --git a/src/aimanager/HISTORY.rst b/src/aimanager/HISTORY.rst new file mode 100644 index 00000000000..f649c5b4602 --- /dev/null +++ b/src/aimanager/HISTORY.rst @@ -0,0 +1,11 @@ +.. :changelog: + +Release History +=============== + +1.0.0 +++++++ +* Initial release. +* ``az aimanager``: Add ``create``, ``update``, ``list``, ``show``, ``delete`` and + ``namespace add/update/list/show/delete`` commands for AI Manager, backed by the vendored + ``azure-mgmt-containerserviceaimanager`` SDK. diff --git a/src/aimanager/README.rst b/src/aimanager/README.rst new file mode 100644 index 00000000000..e58c28b3ac7 --- /dev/null +++ b/src/aimanager/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'aimanager' Extension +========================================== + +This package is for the 'aimanager' extension. +i.e. 'az aimanager' diff --git a/src/aimanager/azext_aimanager/__init__.py b/src/aimanager/azext_aimanager/__init__.py new file mode 100644 index 00000000000..90ae3357bb2 --- /dev/null +++ b/src/aimanager/azext_aimanager/__init__.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azure.cli.core.profiles import register_resource_type + +# pylint: disable=unused-import +from azext_aimanager._help import helps +from azext_aimanager._client_factory import CUSTOM_MGMT_AIMANAGER + + +def register_aimanager_resource_type(): + # The vendored azure-mgmt-containerserviceaimanager SDK is a single-api (typespec) + # package whose operation groups are instance attributes rather than client class + # properties. It is therefore registered with api_version=None (no SDKProfile), which + # lets cmd.get_models resolve models from `.models` directly. + register_resource_type( + "latest", + CUSTOM_MGMT_AIMANAGER, + None, + ) + + +class AIManagerCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + register_aimanager_resource_type() + + aimanager_custom = CliCommandType(operations_tmpl='azext_aimanager.custom#{}') + super().__init__(cli_ctx=cli_ctx, + resource_type=CUSTOM_MGMT_AIMANAGER, + custom_command_type=aimanager_custom) + + def load_command_table(self, args): + from azext_aimanager.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_aimanager._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = AIManagerCommandsLoader diff --git a/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py b/src/aimanager/azext_aimanager/_client_factory.py similarity index 72% rename from src/aks-preview/azext_aks_preview/aimanager/_client_factory.py rename to src/aimanager/azext_aimanager/_client_factory.py index 524ee57a466..e7f531dfdcc 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/_client_factory.py +++ b/src/aimanager/azext_aimanager/_client_factory.py @@ -2,18 +2,12 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -"""Client factory for the ``az aimanager`` command group. - -The vendored ``azure-mgmt-containerserviceaimanager`` SDK is registered as a custom -resource type so models can be resolved via ``cmd.get_models`` (see ``aimanager.py``), -mirroring how ``managed_namespaces`` uses ``CUSTOM_MGMT_AKS_PREVIEW``. -""" from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import CustomResourceType CUSTOM_MGMT_AIMANAGER = CustomResourceType( - 'azext_aks_preview.aimanager.vendored_sdk', + 'azext_aimanager.vendored_sdks', 'ContainerServiceAIManagerMgmtClient') diff --git a/src/aks-preview/azext_aks_preview/aimanager/_help.py b/src/aimanager/azext_aimanager/_help.py similarity index 91% rename from src/aks-preview/azext_aks_preview/aimanager/_help.py rename to src/aimanager/azext_aimanager/_help.py index 75814a51257..3a0200e3e37 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/_help.py +++ b/src/aimanager/azext_aimanager/_help.py @@ -1,13 +1,10 @@ +# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -"""Help definitions for the ``az aimanager`` command group. -Import this module once (from the extension's ``_help.py``) so the strings get registered. -""" - -from knack.help_files import helps +from knack.help_files import helps # pylint: disable=unused-import helps['aimanager'] = """ @@ -61,6 +58,11 @@ text: az aimanager list """ +helps['aimanager wait'] = """ + type: command + short-summary: Wait for an AI Manager resource to reach a desired state. +""" + helps['aimanager namespace'] = """ type: group short-summary: Manage namespaces within an AI Manager. @@ -107,3 +109,8 @@ - name: List namespaces in an AI Manager text: az aimanager namespace list -m my-ai-manager -g myrg """ + +helps['aimanager namespace wait'] = """ + type: command + short-summary: Wait for an AI Manager namespace to reach a desired state. +""" diff --git a/src/aimanager/azext_aimanager/_helpers.py b/src/aimanager/azext_aimanager/_helpers.py new file mode 100644 index 00000000000..062443af792 --- /dev/null +++ b/src/aimanager/azext_aimanager/_helpers.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + + +def parse_key_value_list(pairs): + """Parse a list of ``key=value`` strings into a dictionary.""" + result = {} + if pairs is None: + return result + for pair in pairs: + if "=" not in pair: + raise CLIError(f"Invalid format '{pair}'. Expected format key=value.") + key, value = pair.split("=", 1) + result[key.strip()] = value.strip() + return result + + +def get_aks_custom_headers(aks_custom_headers=None): + """Parse a comma separated ``key=value`` string into a request headers dictionary.""" + headers = {} + if aks_custom_headers is not None: + if aks_custom_headers != "": + for pair in aks_custom_headers.split(','): + parts = pair.split('=') + if len(parts) != 2: + raise CLIError('custom headers format is incorrect') + headers[parts[0]] = parts[1] + return headers diff --git a/src/aks-preview/azext_aks_preview/aimanager/_params.py b/src/aimanager/azext_aimanager/_params.py similarity index 53% rename from src/aks-preview/azext_aks_preview/aimanager/_params.py rename to src/aimanager/azext_aimanager/_params.py index da237789f6b..92f9d70feb2 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/_params.py +++ b/src/aimanager/azext_aimanager/_params.py @@ -2,25 +2,36 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -"""Argument definitions for the ``az aimanager`` command group.""" - +# pylint: disable=line-too-long from azure.cli.core.commands.parameters import ( - get_location_type, tags_type, get_enum_type, get_resource_name_completion_list) + tags_type, + get_location_type, + get_enum_type, + get_resource_name_completion_list, +) +from azext_aimanager.constants import DELETE_POLICIES +from azext_aimanager._validators import ( + validate_ai_manager_name, + validate_namespace_name, + validate_labels, + validate_annotations, +) def load_arguments(self, _): with self.argument_context('aimanager') as c: c.argument('ai_manager_name', options_list=['--name', '-n'], + validator=validate_ai_manager_name, help='The name of the AI Manager resource.', completer=get_resource_name_completion_list('Microsoft.ContainerService/aiManagers')) + c.argument('aks_custom_headers', options_list=['--aks-custom-headers'], + help='Comma-separated key=value pairs to specify custom headers.') for scope in ['aimanager create', 'aimanager update']: with self.argument_context(scope) as c: c.argument('tags', arg_type=tags_type, help='The tags to set to the AI Manager.') - c.argument('delete_policy', arg_type=get_enum_type(['Keep', 'Delete']), - help="Delete options of the AI Manager. Defaults to Delete.") - c.argument('aks_custom_headers') - c.argument('no_wait', help='Do not wait for the long-running operation to finish.') + c.argument('delete_policy', arg_type=get_enum_type(DELETE_POLICIES), + help='Delete options of the AI Manager. Defaults to Delete.') with self.argument_context('aimanager create') as c: c.argument('location', arg_type=get_location_type(self.cli_ctx)) @@ -30,14 +41,17 @@ def load_arguments(self, _): with self.argument_context('aimanager namespace') as c: c.argument('ai_manager_name', options_list=['--manager', '-m'], + validator=validate_ai_manager_name, help='The name of the AI Manager resource.') c.argument('namespace_name', options_list=['--name', '-n'], + validator=validate_namespace_name, help='The name of the AI Manager namespace.') + c.argument('aks_custom_headers', options_list=['--aks-custom-headers'], + help='Comma-separated key=value pairs to specify custom headers.') for scope in ['aimanager namespace add', 'aimanager namespace update']: with self.argument_context(scope) as c: - c.argument('labels', nargs='*', help='Labels applied to the Kubernetes namespace.') - c.argument('annotations', nargs='*', - help='Annotations applied to the Kubernetes namespace.') - c.argument('aks_custom_headers') - c.argument('no_wait', help='Do not wait for the long-running operation to finish.') + c.argument('labels', nargs='*', validator=validate_labels, + help='Space-separated labels (key=value) applied to the Kubernetes namespace.') + c.argument('annotations', nargs='*', validator=validate_annotations, + help='Space-separated annotations (key=value) applied to the Kubernetes namespace.') diff --git a/src/aimanager/azext_aimanager/_validators.py b/src/aimanager/azext_aimanager/_validators.py new file mode 100644 index 00000000000..05563cbe378 --- /dev/null +++ b/src/aimanager/azext_aimanager/_validators.py @@ -0,0 +1,33 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.azclierror import InvalidArgumentValueError + + +def validate_ai_manager_name(namespace): + if namespace.ai_manager_name is not None and not namespace.ai_manager_name.strip(): + raise InvalidArgumentValueError("--name/-n is not a valid AI Manager name.") + + +def validate_namespace_name(namespace): + if getattr(namespace, "namespace_name", None) is not None and not namespace.namespace_name.strip(): + raise InvalidArgumentValueError("--name/-n is not a valid namespace name.") + + +def _validate_key_value_pairs(values, option): + if not values: + return + for item in values: + if "=" not in item or not item.split("=", 1)[0].strip(): + raise InvalidArgumentValueError( + f"{option} '{item}' is not in the expected key=value format.") + + +def validate_labels(namespace): + _validate_key_value_pairs(namespace.labels, "--labels") + + +def validate_annotations(namespace): + _validate_key_value_pairs(namespace.annotations, "--annotations") diff --git a/src/aimanager/azext_aimanager/azext_metadata.json b/src/aimanager/azext_aimanager/azext_metadata.json new file mode 100644 index 00000000000..de366840580 --- /dev/null +++ b/src/aimanager/azext_aimanager/azext_metadata.json @@ -0,0 +1,5 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.61.0", + "version": "1.0.0" +} diff --git a/src/aimanager/azext_aimanager/commands.py b/src/aimanager/azext_aimanager/commands.py new file mode 100644 index 00000000000..252be3c6f89 --- /dev/null +++ b/src/aimanager/azext_aimanager/commands.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.core.commands import CliCommandType +from azext_aimanager._client_factory import ( + cf_ai_managers, + cf_ai_manager_namespaces, +) + + +def load_command_table(self, _): + + ai_managers_sdk = CliCommandType( + operations_tmpl="azext_aimanager.vendored_sdks.operations._operations#AIManagersOperations.{}", + operation_group="ai_managers", + client_factory=cf_ai_managers + ) + + ai_manager_namespaces_sdk = CliCommandType( + operations_tmpl="azext_aimanager.vendored_sdks.operations._operations#AIManagerNamespacesOperations.{}", + operation_group="ai_manager_namespaces", + client_factory=cf_ai_manager_namespaces + ) + + # aimanager command group + with self.command_group("aimanager", ai_managers_sdk, client_factory=cf_ai_managers) as g: + g.custom_command("create", "create_aimanager", supports_no_wait=True) + g.custom_command("update", "update_aimanager", supports_no_wait=True) + g.custom_show_command("show", "show_aimanager") + g.custom_command("list", "list_aimanager") + g.custom_command("delete", "delete_aimanager", supports_no_wait=True, confirmation=True) + g.wait_command("wait") + + # aimanager namespace command group + with self.command_group("aimanager namespace", ai_manager_namespaces_sdk, client_factory=cf_ai_manager_namespaces) as g: + g.custom_command("add", "add_aimanager_namespace", supports_no_wait=True) + g.custom_command("update", "update_aimanager_namespace", supports_no_wait=True) + g.custom_show_command("show", "show_aimanager_namespace") + g.custom_command("list", "list_aimanager_namespace") + g.custom_command("delete", "delete_aimanager_namespace", supports_no_wait=True, confirmation=True) + g.wait_command("wait") diff --git a/src/aimanager/azext_aimanager/constants.py b/src/aimanager/azext_aimanager/constants.py new file mode 100644 index 00000000000..6baa12c7ed1 --- /dev/null +++ b/src/aimanager/azext_aimanager/constants.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# Delete policy values for an AI Manager resource. +DELETE_POLICY_KEEP = "Keep" +DELETE_POLICY_DELETE = "Delete" +DELETE_POLICIES = [DELETE_POLICY_KEEP, DELETE_POLICY_DELETE] diff --git a/src/aimanager/azext_aimanager/custom.py b/src/aimanager/azext_aimanager/custom.py new file mode 100644 index 00000000000..c323505078f --- /dev/null +++ b/src/aimanager/azext_aimanager/custom.py @@ -0,0 +1,231 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.azclierror import ClientRequestError +from azure.cli.core.util import sdk_no_wait +from azure.core.exceptions import ResourceNotFoundError + +from azext_aimanager._client_factory import CUSTOM_MGMT_AIMANAGER +from azext_aimanager._helpers import get_aks_custom_headers, parse_key_value_list + + +def _get_model(cmd, name, operation_group): + return cmd.get_models( + name, + resource_type=CUSTOM_MGMT_AIMANAGER, + operation_group=operation_group, + ) + + +# region AI Manager + +def _construct_aimanager(cmd, location, tags, delete_policy): + ai_manager_properties_model = _get_model(cmd, "AIManagerProperties", "ai_managers") + ai_manager_model = _get_model(cmd, "AIManager", "ai_managers") + + ai_manager = ai_manager_model() + ai_manager.location = location + ai_manager.tags = tags + ai_manager.properties = ai_manager_properties_model(delete_policy=delete_policy) + return ai_manager + + +# pylint: disable=unused-argument +def create_aimanager(cmd, + client, + resource_group_name, + ai_manager_name, + location=None, + tags=None, + delete_policy=None, + aks_custom_headers=None, + no_wait=False): + existing = None + try: + existing = client.get(resource_group_name, ai_manager_name) + except ResourceNotFoundError: + pass + if existing: + raise ClientRequestError( + f"AI Manager '{ai_manager_name}' already exists. " + "Please use 'az aimanager update' to update it.") + + headers = get_aks_custom_headers(aks_custom_headers) + ai_manager = _construct_aimanager(cmd, location, tags, delete_policy) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + ai_manager, + headers=headers, + ) + + +# pylint: disable=unused-argument +def update_aimanager(cmd, + client, + resource_group_name, + ai_manager_name, + tags=None, + delete_policy=None, + aks_custom_headers=None, + no_wait=False): + try: + existing = client.get(resource_group_name, ai_manager_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"AI Manager '{ai_manager_name}' doesn't exist. " + "Please use 'az aimanager list' to get the current list of AI Managers.") + + if tags is None: + tags = existing.tags + existing_properties = existing.properties + if delete_policy is None and existing_properties is not None: + delete_policy = existing_properties.delete_policy + + headers = get_aks_custom_headers(aks_custom_headers) + ai_manager = _construct_aimanager(cmd, existing.location, tags, delete_policy) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + ai_manager, + headers=headers, + ) + + +def show_aimanager(cmd, client, resource_group_name, ai_manager_name): # pylint: disable=unused-argument + return client.get(resource_group_name, ai_manager_name) + + +def list_aimanager(cmd, client, resource_group_name=None): # pylint: disable=unused-argument + if resource_group_name: + return client.list_by_resource_group(resource_group_name) + return client.list_by_subscription() + + +def delete_aimanager(cmd, client, resource_group_name, ai_manager_name, no_wait=False): # pylint: disable=unused-argument + try: + client.get(resource_group_name, ai_manager_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"AI Manager '{ai_manager_name}' doesn't exist. " + "Please use 'az aimanager list' to get the current list of AI Managers.") + + return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, ai_manager_name) + +# endregion + + +# region AI Manager namespace + +def _construct_namespace(cmd, labels, annotations): + namespace_properties_model = _get_model(cmd, "AIManagerNamespaceProperties", "ai_manager_namespaces") + namespace_model = _get_model(cmd, "AIManagerNamespace", "ai_manager_namespaces") + + namespace_config = namespace_model() + namespace_config.properties = namespace_properties_model(labels=labels, annotations=annotations) + return namespace_config + + +# pylint: disable=unused-argument +def add_aimanager_namespace(cmd, + client, + resource_group_name, + ai_manager_name, + namespace_name, + labels=None, + annotations=None, + aks_custom_headers=None, + no_wait=False): + existing = None + try: + existing = client.get(resource_group_name, ai_manager_name, namespace_name) + except ResourceNotFoundError: + pass + if existing: + raise ClientRequestError( + f"Namespace '{namespace_name}' already exists. " + "Please use 'az aimanager namespace update' to update it.") + + headers = get_aks_custom_headers(aks_custom_headers) + namespace_config = _construct_namespace( + cmd, parse_key_value_list(labels), parse_key_value_list(annotations)) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + namespace_name, + namespace_config, + headers=headers, + ) + + +# pylint: disable=unused-argument +def update_aimanager_namespace(cmd, + client, + resource_group_name, + ai_manager_name, + namespace_name, + labels=None, + annotations=None, + aks_custom_headers=None, + no_wait=False): + try: + existing = client.get(resource_group_name, ai_manager_name, namespace_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"Namespace '{namespace_name}' doesn't exist. " + "Please use 'az aimanager namespace list' to get the current list of namespaces.") + + existing_properties = existing.properties + if labels is None: + new_labels = existing_properties.labels if existing_properties is not None else None + else: + new_labels = parse_key_value_list(labels) + if annotations is None: + new_annotations = existing_properties.annotations if existing_properties is not None else None + else: + new_annotations = parse_key_value_list(annotations) + + headers = get_aks_custom_headers(aks_custom_headers) + namespace_config = _construct_namespace(cmd, new_labels, new_annotations) + + return sdk_no_wait( + no_wait, + client.begin_create_or_update, + resource_group_name, + ai_manager_name, + namespace_name, + namespace_config, + headers=headers, + ) + + +def show_aimanager_namespace(cmd, client, resource_group_name, ai_manager_name, namespace_name): # pylint: disable=unused-argument + return client.get(resource_group_name, ai_manager_name, namespace_name) + + +def list_aimanager_namespace(cmd, client, resource_group_name, ai_manager_name): # pylint: disable=unused-argument + return client.list_by_ai_manager(resource_group_name, ai_manager_name) + + +def delete_aimanager_namespace(cmd, client, resource_group_name, ai_manager_name, namespace_name, no_wait=False): # pylint: disable=unused-argument + try: + client.get(resource_group_name, ai_manager_name, namespace_name) + except ResourceNotFoundError: + raise ClientRequestError( + f"Namespace '{namespace_name}' doesn't exist. " + "Please use 'az aimanager namespace list' to get the current list of namespaces.") + + return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, ai_manager_name, namespace_name) + +# endregion diff --git a/src/aks-preview/azext_aks_preview/aimanager/__init__.py b/src/aimanager/azext_aimanager/tests/__init__.py similarity index 73% rename from src/aks-preview/azext_aks_preview/aimanager/__init__.py rename to src/aimanager/azext_aimanager/tests/__init__.py index 34913fb394d..99c0f28cd71 100644 --- a/src/aks-preview/azext_aks_preview/aimanager/__init__.py +++ b/src/aimanager/azext_aimanager/tests/__init__.py @@ -1,4 +1,5 @@ -# -------------------------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aimanager/azext_aimanager/tests/latest/__init__.py b/src/aimanager/azext_aimanager/tests/latest/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aimanager/azext_aimanager/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aimanager/azext_aimanager/tests/latest/test_aimanager_helpers.py b/src/aimanager/azext_aimanager/tests/latest/test_aimanager_helpers.py new file mode 100644 index 00000000000..0e662c7f2b3 --- /dev/null +++ b/src/aimanager/azext_aimanager/tests/latest/test_aimanager_helpers.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import unittest + +from knack.util import CLIError +from azext_aimanager._helpers import parse_key_value_list, get_aks_custom_headers + + +class TestAIManagerHelpers(unittest.TestCase): + """Test cases for AI Manager helper functions.""" + + def test_parse_key_value_list_none(self): + self.assertEqual(parse_key_value_list(None), {}) + + def test_parse_key_value_list_pairs(self): + self.assertEqual( + parse_key_value_list(["team=alpha", "env=prod"]), + {"team": "alpha", "env": "prod"}) + + def test_parse_key_value_list_invalid(self): + with self.assertRaises(CLIError): + parse_key_value_list(["invalid"]) + + def test_get_aks_custom_headers_empty(self): + self.assertEqual(get_aks_custom_headers(None), {}) + self.assertEqual(get_aks_custom_headers(""), {}) + + def test_get_aks_custom_headers_pairs(self): + self.assertEqual( + get_aks_custom_headers("a=1,b=2"), + {"a": "1", "b": "2"}) + + def test_get_aks_custom_headers_invalid(self): + with self.assertRaises(CLIError): + get_aks_custom_headers("badheader") + + +if __name__ == '__main__': + unittest.main() diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_client.py b/src/aimanager/azext_aimanager/vendored_sdks/_client.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_client.py rename to src/aimanager/azext_aimanager/vendored_sdks/_client.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_configuration.py b/src/aimanager/azext_aimanager/vendored_sdks/_configuration.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_configuration.py rename to src/aimanager/azext_aimanager/vendored_sdks/_configuration.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/_patch.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/_patch.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/_utils/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/_utils/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/model_base.py b/src/aimanager/azext_aimanager/vendored_sdks/_utils/model_base.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/model_base.py rename to src/aimanager/azext_aimanager/vendored_sdks/_utils/model_base.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/serialization.py b/src/aimanager/azext_aimanager/vendored_sdks/_utils/serialization.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/serialization.py rename to src/aimanager/azext_aimanager/vendored_sdks/_utils/serialization.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/utils.py b/src/aimanager/azext_aimanager/vendored_sdks/_utils/utils.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_utils/utils.py rename to src/aimanager/azext_aimanager/vendored_sdks/_utils/utils.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_validation.py b/src/aimanager/azext_aimanager/vendored_sdks/_validation.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_validation.py rename to src/aimanager/azext_aimanager/vendored_sdks/_validation.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_version.py b/src/aimanager/azext_aimanager/vendored_sdks/_version.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/_version.py rename to src/aimanager/azext_aimanager/vendored_sdks/_version.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_client.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/_client.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_client.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/_client.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_configuration.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/_configuration.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_configuration.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/_configuration.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/_patch.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/_patch.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/operations/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/operations/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_operations.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_operations.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_operations.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_operations.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_patch.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/aio/operations/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_patch.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/models/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/models/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_enums.py b/src/aimanager/azext_aimanager/vendored_sdks/models/_enums.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_enums.py rename to src/aimanager/azext_aimanager/vendored_sdks/models/_enums.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_models.py b/src/aimanager/azext_aimanager/vendored_sdks/models/_models.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_models.py rename to src/aimanager/azext_aimanager/vendored_sdks/models/_models.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/models/_patch.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/models/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/models/_patch.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/operations/__init__.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/operations/__init__.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_operations.py b/src/aimanager/azext_aimanager/vendored_sdks/operations/_operations.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_operations.py rename to src/aimanager/azext_aimanager/vendored_sdks/operations/_operations.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/operations/_patch.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/operations/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/operations/_patch.py diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/py.typed b/src/aimanager/azext_aimanager/vendored_sdks/py.typed similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/py.typed rename to src/aimanager/azext_aimanager/vendored_sdks/py.typed diff --git a/src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/types.py b/src/aimanager/azext_aimanager/vendored_sdks/types.py similarity index 100% rename from src/aks-preview/azext_aks_preview/aimanager/vendored_sdk/types.py rename to src/aimanager/azext_aimanager/vendored_sdks/types.py diff --git a/src/aimanager/setup.cfg b/src/aimanager/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/aimanager/setup.py b/src/aimanager/setup.py new file mode 100644 index 00000000000..2d538e28b04 --- /dev/null +++ b/src/aimanager/setup.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +VERSION = '1.0.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='aimanager', + version=VERSION, + description='Microsoft Azure Command-Line Tools AI Manager Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/aimanager', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_aimanager': ['azext_metadata.json']}, +) diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index 2b9bf5cf148..e2b97761e0f 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -11,7 +11,6 @@ To release a new version, please select a new version number (usually plus 1 to Pending +++++++ -* `az aimanager`: Add `create`, `update`, `list`, `show`, `delete` and `namespace add/update/list/show/delete` commands for AI Manager, backed by the vendored `azure-mgmt-containerserviceaimanager` SDK. * Fix `match_condition` kwarg leaking to HTTP transport by overriding `put_mc` and `add_agentpool` to pass `if_match` / `if_none_match` directly to the vendored SDK. This change fixes the compatibility issue as azure-cli/acs module adopts TypeSpec emitted SDKs while azure-cli-extensions/aks-preview still uses the autorest emitted SDK. + `az aks list-vm-skus`: New command to list available VM SKUs for AKS clusters in a given region. * `az aks create/update`: Add `--enable-service-account-image-pull`, `--disable-service-account-image-pull`, and `--service-account-image-pull-default-managed-identity-id` parameters to manage service account based image pull settings. diff --git a/src/aks-preview/azext_aks_preview/__init__.py b/src/aks-preview/azext_aks_preview/__init__.py index 6f4dfd3cdf7..e0074aaf43f 100644 --- a/src/aks-preview/azext_aks_preview/__init__.py +++ b/src/aks-preview/azext_aks_preview/__init__.py @@ -10,7 +10,6 @@ # pylint: disable=unused-import import azext_aks_preview._help from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW -from azext_aks_preview.aimanager._client_factory import CUSTOM_MGMT_AIMANAGER def register_aks_preview_resource_type(): @@ -19,11 +18,6 @@ def register_aks_preview_resource_type(): CUSTOM_MGMT_AKS_PREVIEW, None, ) - register_resource_type( - "latest", - CUSTOM_MGMT_AIMANAGER, - None, - ) class ContainerServiceCommandsLoader(AzCommandsLoader): diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index 813cfa53499..cac2a156f5c 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -4553,6 +4553,3 @@ - name: Show a specific JWT authenticator configuration text: az aks jwtauthenticator show -g MyResourceGroup --cluster-name MyCluster --name myjwt """ - -# AI Manager (az aimanager) command help - vendored-SDK approach -from .aimanager import _help # noqa: F401,E402 diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index 1a700ca842d..b1c272c44d9 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -3247,10 +3247,6 @@ def load_arguments(self, _): help="Show all VM SKU information including those not available for the current subscription.", ) - # AI Manager (az aimanager) commands - vendored-SDK approach - from .aimanager._params import load_arguments as _load_aimanager_arguments - _load_aimanager_arguments(self, _) - def _get_default_install_location(exe_name): system = platform.system() diff --git a/src/aks-preview/azext_aks_preview/aimanager/aimanager.py b/src/aks-preview/azext_aks_preview/aimanager/aimanager.py deleted file mode 100644 index e27d8fe0c16..00000000000 --- a/src/aks-preview/azext_aks_preview/aimanager/aimanager.py +++ /dev/null @@ -1,183 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Model builders and SDK invocations for the ``az aimanager`` command group. - -Mirrors the ``managednamespace.py`` structure: command handlers in ``custom.py`` gather the -raw parameters and delegate here, where the models are resolved through -``cmd.get_models`` (the vendored SDK registered as ``CUSTOM_MGMT_AIMANAGER``) and the -operation-group methods are called through ``sdk_no_wait``. -""" - -from azure.cli.core.util import sdk_no_wait - -from ._client_factory import CUSTOM_MGMT_AIMANAGER - - -def parse_key_value_list(pairs): - result = {} - if pairs is None: - return result - for pair in pairs: - if "=" not in pair: - raise ValueError(f"Invalid format '{pair}'. Expected format key=value.") - key, value = pair.split("=", 1) - result[key.strip()] = value.strip() - return result - - -def _get_model(cmd, name, operation_group): - return cmd.get_models( - name, - resource_type=CUSTOM_MGMT_AIMANAGER, - operation_group=operation_group, - ) - - -# region AI Manager - -def constructAIManager(cmd, raw_parameters): - location = raw_parameters.get("location") - tags = raw_parameters.get("tags") - delete_policy = raw_parameters.get("delete_policy") - - AIManagerProperties = _get_model(cmd, "AIManagerProperties", "ai_managers") - AIManager = _get_model(cmd, "AIManager", "ai_managers") - - ai_manager = AIManager() - ai_manager.location = location - ai_manager.tags = tags - ai_manager.properties = AIManagerProperties(delete_policy=delete_policy) - return ai_manager - - -def updateAIManager(cmd, raw_parameters, existedAIManager): - tags = raw_parameters.get("tags") - delete_policy = raw_parameters.get("delete_policy") - - if tags is None: - tags = existedAIManager.tags - - existing_properties = existedAIManager.properties - if delete_policy is None and existing_properties is not None: - delete_policy = existing_properties.delete_policy - - AIManagerProperties = _get_model(cmd, "AIManagerProperties", "ai_managers") - AIManager = _get_model(cmd, "AIManager", "ai_managers") - - ai_manager = AIManager() - ai_manager.location = existedAIManager.location - ai_manager.tags = tags - ai_manager.properties = AIManagerProperties(delete_policy=delete_policy) - return ai_manager - - -def aks_aimanager_create(cmd, client, raw_parameters, headers, no_wait): - resource_group_name = raw_parameters.get("resource_group_name") - ai_manager_name = raw_parameters.get("ai_manager_name") - - ai_manager = constructAIManager(cmd, raw_parameters) - - return sdk_no_wait( - no_wait, - client.begin_create_or_update, - resource_group_name, - ai_manager_name, - ai_manager, - headers=headers, - ) - - -def aks_aimanager_update(cmd, client, raw_parameters, headers, existedAIManager, no_wait): - resource_group_name = raw_parameters.get("resource_group_name") - ai_manager_name = raw_parameters.get("ai_manager_name") - - ai_manager = updateAIManager(cmd, raw_parameters, existedAIManager) - - return sdk_no_wait( - no_wait, - client.begin_create_or_update, - resource_group_name, - ai_manager_name, - ai_manager, - headers=headers, - ) - -# endregion - - -# region AI Manager namespace - -def constructNamespace(cmd, raw_parameters): - labels = parse_key_value_list(raw_parameters.get("labels")) - annotations = parse_key_value_list(raw_parameters.get("annotations")) - - NamespaceProperties = _get_model(cmd, "AIManagerNamespaceProperties", "ai_manager_namespaces") - Namespace = _get_model(cmd, "AIManagerNamespace", "ai_manager_namespaces") - - namespace_config = Namespace() - namespace_config.properties = NamespaceProperties(labels=labels, annotations=annotations) - return namespace_config - - -def updateNamespace(cmd, raw_parameters, existedNamespace): - labels_raw = raw_parameters.get("labels") - annotations_raw = raw_parameters.get("annotations") - - existing_properties = existedNamespace.properties - - if labels_raw is None: - labels = existing_properties.labels if existing_properties is not None else None - else: - labels = parse_key_value_list(labels_raw) - - if annotations_raw is None: - annotations = existing_properties.annotations if existing_properties is not None else None - else: - annotations = parse_key_value_list(annotations_raw) - - NamespaceProperties = _get_model(cmd, "AIManagerNamespaceProperties", "ai_manager_namespaces") - Namespace = _get_model(cmd, "AIManagerNamespace", "ai_manager_namespaces") - - namespace_config = Namespace() - namespace_config.properties = NamespaceProperties(labels=labels, annotations=annotations) - return namespace_config - - -def aks_aimanager_namespace_add(cmd, client, raw_parameters, headers, no_wait): - resource_group_name = raw_parameters.get("resource_group_name") - ai_manager_name = raw_parameters.get("ai_manager_name") - namespace_name = raw_parameters.get("namespace_name") - - namespace_config = constructNamespace(cmd, raw_parameters) - - return sdk_no_wait( - no_wait, - client.begin_create_or_update, - resource_group_name, - ai_manager_name, - namespace_name, - namespace_config, - headers=headers, - ) - - -def aks_aimanager_namespace_update(cmd, client, raw_parameters, headers, existedNamespace, no_wait): - resource_group_name = raw_parameters.get("resource_group_name") - ai_manager_name = raw_parameters.get("ai_manager_name") - namespace_name = raw_parameters.get("namespace_name") - - namespace_config = updateNamespace(cmd, raw_parameters, existedNamespace) - - return sdk_no_wait( - no_wait, - client.begin_create_or_update, - resource_group_name, - ai_manager_name, - namespace_name, - namespace_config, - headers=headers, - ) - -# endregion diff --git a/src/aks-preview/azext_aks_preview/aimanager/commands.py b/src/aks-preview/azext_aks_preview/aimanager/commands.py deleted file mode 100644 index 0b53a53f432..00000000000 --- a/src/aks-preview/azext_aks_preview/aimanager/commands.py +++ /dev/null @@ -1,51 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Command registration for the ``az aimanager`` command group. - -Mirrors the ``aks namespace`` registration: each command group is anchored on the vendored -SDK operations class, while the individual commands are wired to the custom handlers. -This module is loaded from the extension's top-level ``commands.py``. -""" - -from azure.cli.core.commands import CliCommandType - -from ._client_factory import cf_ai_managers, cf_ai_manager_namespaces - - -def load_command_table(self, _): - aimanager_custom = CliCommandType( - operations_tmpl='azext_aks_preview.aimanager.custom#{}', - ) - - ai_managers_sdk = CliCommandType( - operations_tmpl='azext_aks_preview.aimanager.vendored_sdk.operations.' - '_operations#AIManagersOperations.{}', - client_factory=cf_ai_managers, - ) - - ai_manager_namespaces_sdk = CliCommandType( - operations_tmpl='azext_aks_preview.aimanager.vendored_sdk.operations.' - '_operations#AIManagerNamespacesOperations.{}', - client_factory=cf_ai_manager_namespaces, - ) - - with self.command_group('aimanager', ai_managers_sdk, - custom_command_type=aimanager_custom, - client_factory=cf_ai_managers, is_preview=True) as g: - g.custom_command('create', 'aimanager_create', supports_no_wait=True) - g.custom_command('update', 'aimanager_update', supports_no_wait=True) - g.custom_show_command('show', 'aimanager_show') - g.custom_command('list', 'aimanager_list') - g.custom_command('delete', 'aimanager_delete', supports_no_wait=True, confirmation=True) - - with self.command_group('aimanager namespace', ai_manager_namespaces_sdk, - custom_command_type=aimanager_custom, - client_factory=cf_ai_manager_namespaces, is_preview=True) as g: - g.custom_command('add', 'aimanager_namespace_add', supports_no_wait=True) - g.custom_command('update', 'aimanager_namespace_update', supports_no_wait=True) - g.custom_show_command('show', 'aimanager_namespace_show') - g.custom_command('list', 'aimanager_namespace_list') - g.custom_command('delete', 'aimanager_namespace_delete', - supports_no_wait=True, confirmation=True) diff --git a/src/aks-preview/azext_aks_preview/aimanager/custom.py b/src/aks-preview/azext_aks_preview/aimanager/custom.py deleted file mode 100644 index 6a480e1ef7a..00000000000 --- a/src/aks-preview/azext_aks_preview/aimanager/custom.py +++ /dev/null @@ -1,190 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -"""Command handlers for the ``az aimanager`` command group. - -These mirror the ``aks namespace`` (managed namespace) structure: each mutating handler -performs an existence check with a friendly error, snapshots the raw parameters via -``locals()`` and delegates model construction / SDK calls to ``aimanager.py``. -""" - -from azure.cli.core.azclierror import ClientRequestError -from azure.core.exceptions import ResourceNotFoundError - -from .aimanager import ( - aks_aimanager_create, - aks_aimanager_update, - aks_aimanager_namespace_add, - aks_aimanager_namespace_update, -) - - -def _get_custom_headers(aks_custom_headers): - from azext_aks_preview.custom import get_aks_custom_headers - return get_aks_custom_headers(aks_custom_headers) - - -# region AI Manager - -# pylint: disable=unused-argument -def aimanager_create( - cmd, - client, - resource_group_name, - ai_manager_name, - location=None, - tags=None, - delete_policy=None, - aks_custom_headers=None, - no_wait=False, -): - existedAIManager = None - try: - existedAIManager = client.get(resource_group_name, ai_manager_name) - except ResourceNotFoundError: - pass - - if existedAIManager: - raise ClientRequestError( - f"AI Manager '{ai_manager_name}' already exists. " - "Please use 'az aimanager update' to update it." - ) - - # DO NOT MOVE: get all the original parameters and save them as a dictionary - raw_parameters = locals() - headers = _get_custom_headers(aks_custom_headers) - return aks_aimanager_create(cmd, client, raw_parameters, headers, no_wait) - - -# pylint: disable=unused-argument -def aimanager_update( - cmd, - client, - resource_group_name, - ai_manager_name, - tags=None, - delete_policy=None, - aks_custom_headers=None, - no_wait=False, -): - try: - existedAIManager = client.get(resource_group_name, ai_manager_name) - except ResourceNotFoundError: - raise ClientRequestError( - f"AI Manager '{ai_manager_name}' doesn't exist. " - "Please use 'az aimanager list' to get the current list of AI Managers." - ) - - # DO NOT MOVE: get all the original parameters and save them as a dictionary - raw_parameters = locals() - headers = _get_custom_headers(aks_custom_headers) - return aks_aimanager_update(cmd, client, raw_parameters, headers, existedAIManager, no_wait) - - -def aimanager_show(cmd, client, resource_group_name, ai_manager_name): # pylint: disable=unused-argument - return client.get(resource_group_name, ai_manager_name) - - -def aimanager_list(cmd, client, resource_group_name=None): # pylint: disable=unused-argument - if resource_group_name: - return client.list_by_resource_group(resource_group_name) - return client.list_by_subscription() - - -def aimanager_delete(cmd, client, resource_group_name, ai_manager_name, no_wait=False): # pylint: disable=unused-argument - from azure.cli.core.util import sdk_no_wait - - try: - client.get(resource_group_name, ai_manager_name) - except ResourceNotFoundError: - raise ClientRequestError( - f"AI Manager '{ai_manager_name}' doesn't exist. " - "Please use 'az aimanager list' to get the current list of AI Managers." - ) - - return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, ai_manager_name) - -# endregion - - -# region AI Manager namespace - -# pylint: disable=unused-argument -def aimanager_namespace_add( - cmd, - client, - resource_group_name, - ai_manager_name, - namespace_name, - labels=None, - annotations=None, - aks_custom_headers=None, - no_wait=False, -): - existedNamespace = None - try: - existedNamespace = client.get(resource_group_name, ai_manager_name, namespace_name) - except ResourceNotFoundError: - pass - - if existedNamespace: - raise ClientRequestError( - f"Namespace '{namespace_name}' already exists. " - "Please use 'az aimanager namespace update' to update it." - ) - - # DO NOT MOVE: get all the original parameters and save them as a dictionary - raw_parameters = locals() - headers = _get_custom_headers(aks_custom_headers) - return aks_aimanager_namespace_add(cmd, client, raw_parameters, headers, no_wait) - - -# pylint: disable=unused-argument -def aimanager_namespace_update( - cmd, - client, - resource_group_name, - ai_manager_name, - namespace_name, - labels=None, - annotations=None, - aks_custom_headers=None, - no_wait=False, -): - try: - existedNamespace = client.get(resource_group_name, ai_manager_name, namespace_name) - except ResourceNotFoundError: - raise ClientRequestError( - f"Namespace '{namespace_name}' doesn't exist. " - "Please use 'az aimanager namespace list' to get the current list of namespaces." - ) - - # DO NOT MOVE: get all the original parameters and save them as a dictionary - raw_parameters = locals() - headers = _get_custom_headers(aks_custom_headers) - return aks_aimanager_namespace_update(cmd, client, raw_parameters, headers, existedNamespace, no_wait) - - -def aimanager_namespace_show(cmd, client, resource_group_name, ai_manager_name, namespace_name): # pylint: disable=unused-argument - return client.get(resource_group_name, ai_manager_name, namespace_name) - - -def aimanager_namespace_list(cmd, client, resource_group_name, ai_manager_name): # pylint: disable=unused-argument - return client.list_by_ai_manager(resource_group_name, ai_manager_name) - - -def aimanager_namespace_delete(cmd, client, resource_group_name, ai_manager_name, namespace_name, no_wait=False): # pylint: disable=unused-argument - from azure.cli.core.util import sdk_no_wait - - try: - client.get(resource_group_name, ai_manager_name, namespace_name) - except ResourceNotFoundError: - raise ClientRequestError( - f"Namespace '{namespace_name}' doesn't exist. " - "Please use 'az aimanager namespace list' to get the current list of namespaces." - ) - - return sdk_no_wait(no_wait, client.begin_delete, resource_group_name, ai_manager_name, namespace_name) - -# endregion diff --git a/src/aks-preview/azext_aks_preview/commands.py b/src/aks-preview/azext_aks_preview/commands.py index 2283156497e..647fb4deaa6 100644 --- a/src/aks-preview/azext_aks_preview/commands.py +++ b/src/aks-preview/azext_aks_preview/commands.py @@ -628,7 +628,3 @@ def load_command_table(self, _): self.command_table["aks safeguards delete"] = Delete(loader=self) self.command_table["aks safeguards list"] = List(loader=self) self.command_table["aks safeguards wait"] = Wait(loader=self) - - # AI Manager (az aimanager) commands - vendored-SDK approach - from .aimanager.commands import load_command_table as _load_aimanager_commands - _load_aimanager_commands(self, _) From de15beef55a8d951326244312e7d0472f2fa25c0 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Wed, 5 Aug 2026 23:16:24 +0000 Subject: [PATCH 06/11] Nest aimanager vendored SDK under versioned folder Move the vendored typespec SDK into azext_aimanager/vendored_sdks/v2026_05_02_preview to mirror fleet's vendored_sdks/v layout, add a top-level vendored_sdks/__init__.py re-exporting the client, and point the CustomResourceType import prefix and command operation templates at the versioned package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/aimanager/azext_aimanager/__init__.py | 6 ++-- .../azext_aimanager/_client_factory.py | 2 +- src/aimanager/azext_aimanager/commands.py | 4 +-- .../azext_aimanager/vendored_sdks/__init__.py | 25 ++------------- .../v2026_05_02_preview/__init__.py | 32 +++++++++++++++++++ .../{ => v2026_05_02_preview}/_client.py | 0 .../_configuration.py | 0 .../{ => v2026_05_02_preview}/_patch.py | 0 .../_utils/__init__.py | 0 .../_utils/model_base.py | 0 .../_utils/serialization.py | 0 .../{ => v2026_05_02_preview}/_utils/utils.py | 0 .../{ => v2026_05_02_preview}/_validation.py | 0 .../{ => v2026_05_02_preview}/_version.py | 0 .../{ => v2026_05_02_preview}/aio/__init__.py | 0 .../{ => v2026_05_02_preview}/aio/_client.py | 0 .../aio/_configuration.py | 0 .../{ => v2026_05_02_preview}/aio/_patch.py | 0 .../aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 0 .../aio/operations/_patch.py | 0 .../models/__init__.py | 0 .../models/_enums.py | 0 .../models/_models.py | 0 .../models/_patch.py | 0 .../operations/__init__.py | 0 .../operations/_operations.py | 0 .../operations/_patch.py | 0 .../{ => v2026_05_02_preview}/py.typed | 0 .../{ => v2026_05_02_preview}/types.py | 0 30 files changed, 41 insertions(+), 28 deletions(-) create mode 100644 src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/__init__.py rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_client.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_configuration.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_patch.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_utils/__init__.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_utils/model_base.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_utils/serialization.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_utils/utils.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_validation.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/_version.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/__init__.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/_client.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/_configuration.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/_patch.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/operations/__init__.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/operations/_operations.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/aio/operations/_patch.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/models/__init__.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/models/_enums.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/models/_models.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/models/_patch.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/operations/__init__.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/operations/_operations.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/operations/_patch.py (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/py.typed (100%) rename src/aimanager/azext_aimanager/vendored_sdks/{ => v2026_05_02_preview}/types.py (100%) diff --git a/src/aimanager/azext_aimanager/__init__.py b/src/aimanager/azext_aimanager/__init__.py index 90ae3357bb2..7ba18314e9a 100644 --- a/src/aimanager/azext_aimanager/__init__.py +++ b/src/aimanager/azext_aimanager/__init__.py @@ -14,8 +14,10 @@ def register_aimanager_resource_type(): # The vendored azure-mgmt-containerserviceaimanager SDK is a single-api (typespec) # package whose operation groups are instance attributes rather than client class - # properties. It is therefore registered with api_version=None (no SDKProfile), which - # lets cmd.get_models resolve models from `.models` directly. + # properties, so an SDKProfile-based lookup cannot resolve them. It is therefore + # registered with api_version=None (no SDKProfile); the CustomResourceType import + # prefix points at the versioned package so cmd.get_models resolves models from + # `azext_aimanager.vendored_sdks.v2026_05_02_preview.models` directly. register_resource_type( "latest", CUSTOM_MGMT_AIMANAGER, diff --git a/src/aimanager/azext_aimanager/_client_factory.py b/src/aimanager/azext_aimanager/_client_factory.py index e7f531dfdcc..9e96df5e4a0 100644 --- a/src/aimanager/azext_aimanager/_client_factory.py +++ b/src/aimanager/azext_aimanager/_client_factory.py @@ -7,7 +7,7 @@ from azure.cli.core.profiles import CustomResourceType CUSTOM_MGMT_AIMANAGER = CustomResourceType( - 'azext_aimanager.vendored_sdks', + 'azext_aimanager.vendored_sdks.v2026_05_02_preview', 'ContainerServiceAIManagerMgmtClient') diff --git a/src/aimanager/azext_aimanager/commands.py b/src/aimanager/azext_aimanager/commands.py index 252be3c6f89..335da7e674a 100644 --- a/src/aimanager/azext_aimanager/commands.py +++ b/src/aimanager/azext_aimanager/commands.py @@ -14,13 +14,13 @@ def load_command_table(self, _): ai_managers_sdk = CliCommandType( - operations_tmpl="azext_aimanager.vendored_sdks.operations._operations#AIManagersOperations.{}", + operations_tmpl="azext_aimanager.vendored_sdks.v2026_05_02_preview.operations._operations#AIManagersOperations.{}", operation_group="ai_managers", client_factory=cf_ai_managers ) ai_manager_namespaces_sdk = CliCommandType( - operations_tmpl="azext_aimanager.vendored_sdks.operations._operations#AIManagerNamespacesOperations.{}", + operations_tmpl="azext_aimanager.vendored_sdks.v2026_05_02_preview.operations._operations#AIManagerNamespacesOperations.{}", operation_group="ai_manager_namespaces", client_factory=cf_ai_manager_namespaces ) diff --git a/src/aimanager/azext_aimanager/vendored_sdks/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/__init__.py index d29c554dcee..fdfa2b91c8f 100644 --- a/src/aimanager/azext_aimanager/vendored_sdks/__init__.py +++ b/src/aimanager/azext_aimanager/vendored_sdks/__init__.py @@ -5,28 +5,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position -from typing import TYPE_CHECKING +from .v2026_05_02_preview import ContainerServiceAIManagerMgmtClient -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import ContainerServiceAIManagerMgmtClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ContainerServiceAIManagerMgmtClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() +__all__ = ['ContainerServiceAIManagerMgmtClient'] diff --git a/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/__init__.py new file mode 100644 index 00000000000..d29c554dcee --- /dev/null +++ b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ContainerServiceAIManagerMgmtClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceAIManagerMgmtClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_client.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_client.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_client.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_client.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_configuration.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_configuration.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_configuration.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_configuration.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_patch.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_patch.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_utils/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/__init__.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_utils/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/__init__.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_utils/model_base.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/model_base.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_utils/model_base.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/model_base.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_utils/serialization.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/serialization.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_utils/serialization.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/serialization.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_utils/utils.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/utils.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_utils/utils.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_utils/utils.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_validation.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_validation.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_validation.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_validation.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/_version.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_version.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/_version.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/_version.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/__init__.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/__init__.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/_client.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/_client.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/_client.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/_client.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/_configuration.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/_configuration.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/_configuration.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/_configuration.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/_patch.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/_patch.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/operations/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/operations/__init__.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/operations/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/operations/__init__.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_operations.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/operations/_operations.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_operations.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/operations/_operations.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/operations/_patch.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/aio/operations/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/aio/operations/_patch.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/models/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/__init__.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/models/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/__init__.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/models/_enums.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/_enums.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/models/_enums.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/_enums.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/models/_models.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/_models.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/models/_models.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/_models.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/models/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/_patch.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/models/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/models/_patch.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/operations/__init__.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/operations/__init__.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/operations/__init__.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/operations/__init__.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/operations/_operations.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/operations/_operations.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/operations/_operations.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/operations/_operations.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/operations/_patch.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/operations/_patch.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/operations/_patch.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/operations/_patch.py diff --git a/src/aimanager/azext_aimanager/vendored_sdks/py.typed b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/py.typed similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/py.typed rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/py.typed diff --git a/src/aimanager/azext_aimanager/vendored_sdks/types.py b/src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/types.py similarity index 100% rename from src/aimanager/azext_aimanager/vendored_sdks/types.py rename to src/aimanager/azext_aimanager/vendored_sdks/v2026_05_02_preview/types.py From a3aac89b0acc02cfc20a7a0963719f933b2e0778 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Thu, 6 Aug 2026 16:44:22 +0000 Subject: [PATCH 07/11] Add e2e scenario test for az aimanager Add an azure.cli.testsdk ScenarioTest covering the full aimanager and aimanager namespace command surface (create/wait/show/list/update/delete and namespace add/wait/show/list/update/delete), modeled on fleet's hubful scenario test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/latest/test_aimanager_scenario.py | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 src/aimanager/azext_aimanager/tests/latest/test_aimanager_scenario.py diff --git a/src/aimanager/azext_aimanager/tests/latest/test_aimanager_scenario.py b/src/aimanager/azext_aimanager/tests/latest/test_aimanager_scenario.py new file mode 100644 index 00000000000..34f465f47a5 --- /dev/null +++ b/src/aimanager/azext_aimanager/tests/latest/test_aimanager_scenario.py @@ -0,0 +1,101 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk.scenario_tests import AllowLargeResponse + + +class AIManagerScenarioTest(ScenarioTest): + + @AllowLargeResponse(size_kb=9999) + @ResourceGroupPreparer(name_prefix='cli-aimgr-', random_name_length=16, location='eastus2') + def test_aimanager(self): + self.kwargs.update({ + 'ai_manager_name': self.create_random_name(prefix='aim', length=12), + 'namespace_name': self.create_random_name(prefix='aimns', length=12), + 'location': 'eastus2', + }) + + # region AI Manager + + # create + self.cmd( + 'aimanager create -g {rg} -n {ai_manager_name} -l {location} --delete-policy Keep', + checks=[ + self.check('name', '{ai_manager_name}'), + self.check('location', '{location}'), + self.check('properties.deletePolicy', 'Keep'), + ]) + + # wait + self.cmd('aimanager wait -g {rg} -n {ai_manager_name} --created', checks=[self.is_empty()]) + + # show + self.cmd('aimanager show -g {rg} -n {ai_manager_name}', checks=[ + self.check('name', '{ai_manager_name}'), + self.check('properties.deletePolicy', 'Keep'), + ]) + + # list (resource group) + self.cmd('aimanager list -g {rg}', checks=[ + self.check("length([?name=='{ai_manager_name}'])", 1), + ]) + + # update (tags + delete policy) + self.cmd( + 'aimanager update -g {rg} -n {ai_manager_name} --tags env=test team=alpha --delete-policy Delete', + checks=[ + self.check('name', '{ai_manager_name}'), + self.check('tags.env', 'test'), + self.check('tags.team', 'alpha'), + self.check('properties.deletePolicy', 'Delete'), + ]) + + # endregion + + # region AI Manager namespace + + # add + self.cmd( + 'aimanager namespace add -g {rg} -m {ai_manager_name} -n {namespace_name} ' + '--labels team=alpha --annotations owner=alice', + checks=[ + self.check('name', '{namespace_name}'), + self.check('properties.labels.team', 'alpha'), + self.check('properties.annotations.owner', 'alice'), + ]) + + # wait + self.cmd('aimanager namespace wait -g {rg} -m {ai_manager_name} -n {namespace_name} --created', + checks=[self.is_empty()]) + + # show + self.cmd('aimanager namespace show -g {rg} -m {ai_manager_name} -n {namespace_name}', checks=[ + self.check('name', '{namespace_name}'), + self.check('properties.labels.team', 'alpha'), + ]) + + # list + self.cmd('aimanager namespace list -g {rg} -m {ai_manager_name}', checks=[ + self.check("length([?name=='{namespace_name}'])", 1), + ]) + + # update (labels) + self.cmd( + 'aimanager namespace update -g {rg} -m {ai_manager_name} -n {namespace_name} ' + '--labels team=beta --annotations owner=bob', + checks=[ + self.check('name', '{namespace_name}'), + self.check('properties.labels.team', 'beta'), + self.check('properties.annotations.owner', 'bob'), + ]) + + # delete namespace + self.cmd('aimanager namespace delete -g {rg} -m {ai_manager_name} -n {namespace_name} --yes') + + # endregion + + # delete AI Manager + self.cmd('aimanager delete -g {rg} -n {ai_manager_name} --yes') From e5682c11b031b7cb9691d3d935ea6de0586f9e2a Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Thu, 6 Aug 2026 17:09:48 +0000 Subject: [PATCH 08/11] run e2e test live recording --- .../latest/recordings/test_aimanager.yaml | 3255 +++++++++++++++++ 1 file changed, 3255 insertions(+) create mode 100644 src/aimanager/azext_aimanager/tests/latest/recordings/test_aimanager.yaml diff --git a/src/aimanager/azext_aimanager/tests/latest/recordings/test_aimanager.yaml b/src/aimanager/azext_aimanager/tests/latest/recordings/test_aimanager.yaml new file mode 100644 index 00000000000..2750f59883e --- /dev/null +++ b/src/aimanager/azext_aimanager/tests/latest/recordings/test_aimanager.yaml @@ -0,0 +1,3255 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ContainerService/aiManagers/aim000002'' + under resource group ''cli-aimgr-000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '235' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 06 Aug 2026 16:50:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + x-msedge-ref: + - 'Ref A: 694A9197D14040819B8FC150736DAD2B Ref B: MWH011020807029 Ref C: 2026-08-06T16:50:17Z' + status: + code: 404 + message: Not Found +- request: + body: '{"location": "eastus2", "properties": {"deletePolicy": "Keep"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + Content-Length: + - '63' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","properties":{"provisioningState":"Creating","deletePolicy":"Keep","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"5d617969-8208-469a-a18d-b4a7c3cf7442","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:50:19.4574062Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMIIEjjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIwDAYDVR0TAQH_BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgY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0dXMyL2NhY2VydHMvY2NtZWVhc3R1czJwa2kvY2NtZWVhc3R1czJpY2EwMS9jZXJ0LmNlcjBmBggrBgEFBQcwAoZaaHR0cDovL2NjbWVlYXN0dXMycGtpLmVhc3R1czIucGtpLmNvcmUud2luZG93cy5uZXQvY2VydGlmaWNhdGVBdXRob3JpdGllcy9jY21lZWFzdHVzMmljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQBx5I6Sofmi5yGOz0alPqrZuIh1Qv1Gc7iCefJl7OITobABfs9PqLqAUqQ0NZt02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + cache-control: + - no-cache + content-length: + - '643' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:50:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/42e6bbe2-2526-4afc-98e9-608cd09d9eb2 + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 6BE1C299DC2545F0ACDADBC590144D72 Ref B: MWH011020809031 Ref C: 2026-08-06T16:50:18Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktN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O31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:50:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/7a7dccca-c6f4-4cb6-a1ba-5d2de84f3606 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: D3F636098789464A9542E580B7E475FC Ref B: MWH011020808040 Ref C: 2026-08-06T16:50:20Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMIIEjjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIwDAYDVR0TAQH_BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH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hY2VydHMvY2NtZWVhc3R1czJwa2kvY2NtZWVhc3R1czJpY2EwMS9jZXJ0LmNlcjBmBggrBgEFBQcwAoZaaHR0cDovL2NjbWVlYXN0dXMycGtpLmVhc3R1czIucGtpLmNvcmUud2luZG93cy5uZXQvY2VydGlmaWNhdGVBdXRob3JpdGllcy9jY21lZWFzdHVzMmljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQBx5I6Sofmi5yGOz0alPqrZuIh1Qv1Gc7iCefJl7OITobABfs9PqLqAUqQ0NZt02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:50:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/76daafb4-163c-4bed-adfa-d1ddc3c3c306 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: ED3B8B28648143249692DE0449675106 Ref B: MWH011020807031 Ref C: 2026-08-06T16:50:51Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_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FIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:51:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/28bd2676-0f9d-4467-867c-ba6a41068148 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 81DEB29B6A594E949CD5BF024FFE9089 Ref B: MWH011020808036 Ref C: 2026-08-06T16:51:22Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMIIEjjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIwDAYDVR0T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\"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:51:52 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/841f0267-0ba1-4d32-8f0c-74b4a1989e2d + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 0A76CAD3F9D74A1C87CEF769D504AAAB Ref B: CO6AA3150219047 Ref C: 2026-08-06T16:51:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC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AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:52:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/9ee49560-a93b-43a2-bb7a-4f4f063f2817 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 015DD91C61DB48FEB20C2E94FEF6E1FF Ref B: CO1AA3060816060 Ref C: 2026-08-06T16:52:24Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMIIEjjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1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wKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:52:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/e1809f6b-b76a-47e7-bbaa-91bf89180bbd + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C7C7A15F9E7D4C2382EF324B0FA623FC Ref B: CO6AA3150218017 Ref C: 2026-08-06T16:52:54Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2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XD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:53:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/e627679f-5641-4105-babc-d96c56463286 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 8D08B167CD8640DCAA135D65FCF6E673 Ref B: CO6AA3150220011 Ref C: 2026-08-06T16:53:25Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMIIEjjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYG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gxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:53:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/ccc9bbf3-94ec-45aa-a3d0-7eb774c25898 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 2C885BAC161947B3931EA461216C91A9 Ref B: MWH011020806036 Ref C: 2026-08-06T16:53:55Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFo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02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:54:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/dffc9edd-be73-42c6-a316-7bcdab26b069 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: DF715153280348508B6D6CC5B8C6427E Ref B: CO6AA3150217047 Ref C: 2026-08-06T16:54:26Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMI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4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:54:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/7b2b5092-6f2a-4ee1-a46e-ab2116609a81 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 0C16C23A03D34435A6DD4AE42AD46009 Ref B: CO6AA3150220051 Ref C: 2026-08-06T16:54:57Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxI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CwUAA4IBAQBx5I6Sofmi5yGOz0alPqrZuIh1Qv1Gc7iCefJl7OITobABfs9PqLqAUqQ0NZt02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:55:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/363fb462-2c15-4495-8e97-a6d822f652b0 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 13B1F6B185EF486DAFFE33AE02466CEF Ref B: CO6AA3150219021 Ref C: 2026-08-06T16:55:27Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYb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BBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:55:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/95cb4705-73e1-4824-9e7e-5286957bcada + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 60AB928EC15E4F18B33545953951A197 Ref B: CO6AA3150219019 Ref C: 2026-08-06T16:55:58Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcf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Y2VydGlmaWNhdGVBdXRob3JpdGllcy9jY21lZWFzdHVzMmljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQBx5I6Sofmi5yGOz0alPqrZuIh1Qv1Gc7iCefJl7OITobABfs9PqLqAUqQ0NZt02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:56:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/2e31d673-1c60-4fdc-8706-22003123f890 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C1680158FD734845AF819385B37689E7 Ref B: CO1AA3060816034 Ref C: 2026-08-06T16:56:29Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqM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bA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:57:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/4c1626ea-a8f2-4717-ab63-c14441ded7bb + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: E35FFB2B29C34DA6A0D4D4F7267DC4C8 Ref B: CO1AA3060818031 Ref C: 2026-08-06T16:57:00Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-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cwAoZaaHR0cDovL2NjbWVlYXN0dXMycGtpLmVhc3R1czIucGtpLmNvcmUud2luZG93cy5uZXQvY2VydGlmaWNhdGVBdXRob3JpdGllcy9jY21lZWFzdHVzMmljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQBx5I6Sofmi5yGOz0alPqrZuIh1Qv1Gc7iCefJl7OITobABfs9PqLqAUqQ0NZt02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:57:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/baa013e4-a17e-4a61-bd9d-1d53f45ed5e9 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 6310213B62694587921FA917099D9852 Ref B: CO1AA3060814025 Ref C: 2026-08-06T16:57:30Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ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q2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:58:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/0f11c06b-b9d3-4b6b-b635-e0deb44ae80f + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 6839E113B1254234BF81095B1B595D38 Ref B: MWH011020807034 Ref C: 2026-08-06T16:58:01Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMBGPkVhZavejw0qLifjw8nEBivhzrnSlLVzv8ThjIxvzYq7Pixu564lZgpE4tktNQwXrbdQ8_M_ltt8Ia4jO8Wc47QJt-BIUGY10RRyuDzAEGrQRCDbQB1Kyo6IjF95ihEDSUcGthqOIsbqMERKgZokdpO3a8ikGNKVtOb3zrePXR71iCDdkdamGIsPVfGxaBtUDO5vqdKugYbOQDFCYaQdk7x3VINyRpvZXpU4-B41mD-vXX5Rm_X9BL0jN1rjSRIFvfK3YkxAgMBAAGjggSSMIIEjjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIwDAYDVR0TAQH_BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH_BAQDAgW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Y2NtZWVhc3R1czJwa2kvY2NtZWVhc3R1czJpY2EwMS9jZXJ0LmNlcjBmBggrBgEFBQcwAoZaaHR0cDovL2NjbWVlYXN0dXMycGtpLmVhc3R1czIucGtpLmNvcmUud2luZG93cy5uZXQvY2VydGlmaWNhdGVBdXRob3JpdGllcy9jY21lZWFzdHVzMmljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQBx5I6Sofmi5yGOz0alPqrZuIh1Qv1Gc7iCefJl7OITobABfs9PqLqAUqQ0NZt02K2ag8zFQWRLn3xJESxYpGcBV7meAUTJOJhRHdvwqFTOMyPwYKbVpl-gdceRQV0J4MdXD1EG8ZfrQqJh4yTpH9fs1bJNlNwJZx_jinURgGNM3AvMcEe8RipqTE4QFDEFqJqWftJzvHLBetVu8Z6AGm5099Z3hgXzQkneb6E4dITNtuFdibgZ_w2TYC64wJ1VSMZoWDioo50604N9fZooi7RvEeWH1iooHPyFIUtevrquxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:58:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/2cd139f6-1bb5-4dd2-8d40-0329dc0fb8da + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: D0D878DE005A41F693506286E49908FC Ref B: MWH011020806029 Ref C: 2026-08-06T16:58:32Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/58b95893-064d-4d28-b1b1-a9ce2a4116fe?api-version=2025-10-01&t=639216318203480416&c=MIIHlDCCBnygAwIBAgIQAcfN_Jd6ViGd1-EkFH97aDANBgkqhkiG9w0BAQsFADA2MTQwMgYDVQQDEytDQ01FIEcxIFRMUyBSU0EgMjA0OCBTSEEyNTYgMjA0OSBFVVMyIENBIDAxMB4XDTI2MDQwOTA0MzUxMFoXDTI2MTAwNDEwMzUxMFowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9nzXnnnT0V5cDY5fHgY6fvt0f5K67TLY5rf3kXsgNDiGJL9Ub1_cJuWgTTjGYmxaPP6HFz_YOLdMB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quxTYiMdLAwbW0FzEjba2h2TLxHn3wd3uzwLiJoLGRIzBT&s=B9SUgn51pO31MlZ18nq2RM2T4nmxP4S8ZZM_KgByqkjGf1S6hkYxsjsLEMEW4LaArcW2aNqS_csQkgDQZVs5XjwrfUXhbA1lktDvbbPGXed38cH6-RPKxdPhiTREhveeyJzmhNFjVR2EX1MyIBGyXIKRLBBZVHchNOVc2tdSYIJ5pme_cXCTMQZ8HQo2BsivE-Q4SsCYlyk3TlIVfyGXmtYtBA3oot0p3A4rpMe0HUUbWAL14uiuAXud8VQtzz1yK3U_DFMh-9eV3FjjJJn7PTcZl4UNZh683vcabfJXgxpX_89tO1_vIKAOy0GbhnSgK6HUWw2OPOrOjvh8_3c0wg&h=aDxcZPfc94j1PK0EZqh22LwKcsDmPIdIYDpHZlmVslQ + response: + body: + string: "{\n \"name\": \"58b95893-064d-4d28-b1b1-a9ce2a4116fe\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2026-08-06T16:50:19.7795997Z\",\n \"endTime\": + \"2026-08-06T16:58:34.7669631Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '165' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/8511f906-d048-4d24-96e7-d82a4d9ef758 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C00664104B9F4EFE9794788A0FAE4054 Ref B: CO1AA3060815025 Ref C: 2026-08-06T16:59:03Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager create + Connection: + - keep-alive + ParameterSetName: + - -g -n -l --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","properties":{"provisioningState":"Succeeded","deletePolicy":"Keep","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"804e2ae4-b28b-430b-88d8-d533da2b67b5","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:50:19.4574062Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '644' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: A0D6CA101B4E482CAEA39E563C4AB736 Ref B: MWH011020809023 Ref C: 2026-08-06T16:59:03Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager wait + Connection: + - keep-alive + ParameterSetName: + - -g -n --created + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","properties":{"provisioningState":"Succeeded","deletePolicy":"Keep","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"804e2ae4-b28b-430b-88d8-d533da2b67b5","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:50:19.4574062Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '644' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: DC74FD2A9E834C3786EF705DC3F2F293 Ref B: CO6AA3150217045 Ref C: 2026-08-06T16:59:04Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","properties":{"provisioningState":"Succeeded","deletePolicy":"Keep","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"804e2ae4-b28b-430b-88d8-d533da2b67b5","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:50:19.4574062Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '644' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 5E187B53B8FA46269D7234EDA9D6B6C8 Ref B: CO6AA3150218033 Ref C: 2026-08-06T16:59:04Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers?api-version=2026-05-02-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","properties":{"provisioningState":"Succeeded","deletePolicy":"Keep","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"804e2ae4-b28b-430b-88d8-d533da2b67b5","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:50:19.4574062Z"}}],"nextLink":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers?api-version=2026-05-02-preview&%24skiptoken=3ZBBT4QwFIT%2fS2P2tKWI6LIkxhBjvMhF1huXt%2bXBPpG2vhbWSPa%2fS0hM%2fA3eJjNzmPlmYfArvJDpvchn8VRUh7cqEbk4heB8rtQABjoc0IQIvkfGSNtB%2bfHoNZMLZI1XGWpoWr2XzTXcyBQhlccsTWXc7Ntsh2mz05li9HZkjc9sR%2beV%2fiAJNHQs3098Hj%2bVYztRg%2bxVSZqtt22IHq0JQAa5Qp5IowIq1znsH8CRnJb6suA%2biZM7Gd%2fKOJGOcSI8b658T%2b5ge1zSzR8tLlsBPBRdx9hBwGbtLH%2bL11JsVxglcI%2b8WHP9y6MWef1fidTiIi4%2f"}' + headers: + cache-control: + - no-cache + content-length: + - '1228' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 06 Aug 2026 16:59:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - '' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 74980D7399D74E6D997250503914CE6C Ref B: MWH011020806042 Ref C: 2026-08-06T16:59:05Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers?api-version=2026-05-02-preview&$skiptoken=3ZBBT4QwFIT/S2P2tKWI6LIkxhBjvMhF1huXt%2BXBPpG2vhbWSPa/S0hM/A3eJjNzmPlmYfArvJDpvchn8VRUh7cqEbk4heB8rtQABjoc0IQIvkfGSNtB%2BfHoNZMLZI1XGWpoWr2XzTXcyBQhlccsTWXc7Ntsh2mz05li9HZkjc9sR%2BeV/iAJNHQs3098Hj%2BVYztRg%2BxVSZqtt22IHq0JQAa5Qp5IowIq1znsH8CRnJb6suA%2BiZM7Gd/KOJGOcSI8b658T%2B5ge1zSzR8tLlsBPBRdx9hBwGbtLH%2BL11JsVxglcI%2B8WHP9y6MWef1fidTiIi4/ + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 06 Aug 2026 16:59:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - '' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 17FD4882128C4819BF7DF8400B702D42 Ref B: MWH011020809034 Ref C: 2026-08-06T16:59:05Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","properties":{"provisioningState":"Succeeded","deletePolicy":"Keep","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"804e2ae4-b28b-430b-88d8-d533da2b67b5","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:50:19.4574062Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '644' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:05 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 4ABA9491E6BC419C8C74DA14C857BD67 Ref B: CO1AA3060817031 Ref C: 2026-08-06T16:59:05Z' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "tags": {"env": "test", "team": "alpha"}, "properties": + {"deletePolicy": "Delete"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager update + Connection: + - keep-alive + Content-Length: + - '107' + Content-Type: + - application/json + ParameterSetName: + - -g -n --tags --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","tags":{"env":"test","team":"alpha"},"properties":{"provisioningState":"Updating","deletePolicy":"Delete","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"ad14da32-19d6-47e3-99b2-72730423bbf0","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:06.5150863Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/46e7f76b-db02-4c25-b421-c8b0da913d51?api-version=2025-10-01&t=639216323467338464&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCis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aaRKdSGSDWeSWgJ2MpAzG_h0Dua_INfeTnzNZE7OgjxdrQTFPMOs6jyK0ugK5Zxm5Z2CIhpuxm-N2Eu-MDu-qA9U9T9fH_XwUVOfhSNz3-Xbmdb7nHiLc9LsN9uVHjzZeV4fsTEgT4HQC5PdAX4W77UpZeM9E5Zg&h=Fr7q_MdMnQ3V3J-Ry75syr43kZBUFz1FXhGqSqhrU-M + cache-control: + - no-cache + content-length: + - '682' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/0a6838d3-4223-416c-a9c7-c50094d9cceb + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: BADCFEEF8C544EC18BDE9145D08F0AD0 Ref B: MWH011020807040 Ref C: 2026-08-06T16:59:06Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/46e7f76b-db02-4c25-b421-c8b0da913d51?api-version=2025-10-01&t=639216323467338464&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hB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2NtZWNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=bCPSAN6VTzH7ZGI6yKFqFMmlIx6c9EKTTHqrGUd34LWKQgomaVar_mqImHElmC4w8zhlkNSsO3txL2LNGvpufK9BhKdP0ZvzTq6BiqUY934h7OlxReSjRQ4KFgWYip2jh_6gWBFlUnAHRhXJ9TZEkkeJzXEvquQfFe1_rjRCpqjE_4BP6dqpsqaaRKdSGSDWeSWgJ2MpAzG_h0Dua_INfeTnzNZE7OgjxdrQTFPMOs6jyK0ugK5Zxm5Z2CIhpuxm-N2Eu-MDu-qA9U9T9fH_XwUVOfhSNz3-Xbmdb7nHiLc9LsN9uVHjzZeV4fsTEgT4HQC5PdAX4W77UpZeM9E5Zg&h=Fr7q_MdMnQ3V3J-Ry75syr43kZBUFz1FXhGqSqhrU-M + response: + body: + string: "{\n \"name\": \"46e7f76b-db02-4c25-b421-c8b0da913d51\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:06.605862Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/232188cf-1452-4652-afee-be208588cdd1 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: FFE8B429DD2E4B3FAABBD9F65B56B2D4 Ref B: CO6AA3150220053 Ref C: 2026-08-06T16:59:06Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/46e7f76b-db02-4c25-b421-c8b0da913d51?api-version=2025-10-01&t=639216323467338464&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQ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6yKFqFMmlIx6c9EKTTHqrGUd34LWKQgomaVar_mqImHElmC4w8zhlkNSsO3txL2LNGvpufK9BhKdP0ZvzTq6BiqUY934h7OlxReSjRQ4KFgWYip2jh_6gWBFlUnAHRhXJ9TZEkkeJzXEvquQfFe1_rjRCpqjE_4BP6dqpsqaaRKdSGSDWeSWgJ2MpAzG_h0Dua_INfeTnzNZE7OgjxdrQTFPMOs6jyK0ugK5Zxm5Z2CIhpuxm-N2Eu-MDu-qA9U9T9fH_XwUVOfhSNz3-Xbmdb7nHiLc9LsN9uVHjzZeV4fsTEgT4HQC5PdAX4W77UpZeM9E5Zg&h=Fr7q_MdMnQ3V3J-Ry75syr43kZBUFz1FXhGqSqhrU-M + response: + body: + string: "{\n \"name\": \"46e7f76b-db02-4c25-b421-c8b0da913d51\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2026-08-06T16:59:06.605862Z\",\n \"endTime\": + \"2026-08-06T16:59:08.6303679Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '164' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/77f8e523-4515-4da2-b2fd-963923fe428f + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 6E8DFE4451024BB19A4D307319AC0EC8 Ref B: MWH011020807042 Ref C: 2026-08-06T16:59:37Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags --delete-policy + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","tags":{"env":"test","team":"alpha"},"properties":{"provisioningState":"Succeeded","deletePolicy":"Delete","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"fbefcefa-ef80-4768-8223-6e10397eda7c","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:06.5150863Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '683' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 607987947089477F9DA14C6C62AF9B93 Ref B: MWH011020806042 Ref C: 2026-08-06T16:59:38Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace add + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"error":{"code":"NotFound","message":"The entity was not found."}}' + headers: + cache-control: + - no-cache + content-length: + - '67' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/519fbd01-1846-4def-9452-ebc5d3a01bd0 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 0F4F89E9840A47CAAC57BF4A19DDD150 Ref B: CO6AA3150219009 Ref C: 2026-08-06T16:59:38Z' + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"labels": {"team": "alpha"}, "annotations": {"owner": "alice"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace add + Connection: + - keep-alive + Content-Length: + - '80' + Content-Type: + - application/json + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Creating","labels":{"team":"alpha"},"annotations":{"owner":"alice"}},"eTag":"7c812b59-8bbe-4e5f-87b1-4c70cacc8dc1","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:39.0313184Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:39.0313184Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/9479c57c-b5a2-48c4-920b-fc1b4186db22?api-version=2025-10-01&t=639216323794063163&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQ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XeYe7SdHxDzG35F-Iw8jYy9_OJmbw&h=QpZ1Dquvdd1WXj2tHsIhHsi4N-ORpz3x_8vc9Qrnh1c + cache-control: + - no-cache + content-length: + - '626' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/c887fbf2-c4f9-44d2-9a8b-6bc9fabd289d + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: B511D0F83A474303B255D29EA33A0B75 Ref B: CO6AA3150220009 Ref C: 2026-08-06T16:59:38Z' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace add + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/9479c57c-b5a2-48c4-920b-fc1b4186db22?api-version=2025-10-01&t=639216323794063163&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuY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jPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=Xh_LkjoeQaZORYdN2xULv2zWSpkhRLRujLnCVXJmQa-8h4VK6pEr3nNw2OwzkAhU-m1pMhqi3Y_F9Ux61t1ffeb-FLOqwWXzU5dJuf8fXCZD3URnfhB9hiVtlxX-hkqlG4pFIJyd6Qg3vYlSZ3CGnZ9eUdXLuRHdeLLQhw2NZNwfsLjO1LCDn8b7ihP6TgK7beGldYcNagYfXMqjIJySDqMe4rzh2mh9vI4RoIGNbD2lUua-EnfdTaBSgWZIhMy3WjwADyGtRnG91wLhECqxBxpKk4CvwZGqZ03Io7hIqzRdbHh2GYO_1CzXPXeYe7SdHxDzG35F-Iw8jYy9_OJmbw&h=QpZ1Dquvdd1WXj2tHsIhHsi4N-ORpz3x_8vc9Qrnh1c + response: + body: + string: "{\n \"name\": \"9479c57c-b5a2-48c4-920b-fc1b4186db22\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2026-08-06T16:59:39.1210871Z\",\n \"endTime\": + \"2026-08-06T16:59:39.6537541Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '165' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/0873403b-4bba-491f-ace7-c01b8855b6c0 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: A19B04FF3F8A4300B0B8407E62749F4A Ref B: CO1AA3060816023 Ref C: 2026-08-06T16:59:39Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace add + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"alpha"},"annotations":{"owner":"alice"}},"eTag":"43639614-5098-42b0-9729-39f92b5edbf2","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:39.0313184Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:39.0313184Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '627' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/7b4cf2cb-67ea-49cc-8ca1-1dd2d013bd23 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 642D3816B6674C68B4008F69010BF081 Ref B: CO6AA3150219017 Ref C: 2026-08-06T16:59:40Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace wait + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --created + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"alpha"},"annotations":{"owner":"alice"}},"eTag":"43639614-5098-42b0-9729-39f92b5edbf2","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:39.0313184Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:39.0313184Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '627' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/6c0d3db6-edf5-40ab-b7db-60f050f068fd + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 465B094A8D414CB8A6CCF77FAC912B83 Ref B: MWH011020809054 Ref C: 2026-08-06T16:59:40Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace show + Connection: + - keep-alive + ParameterSetName: + - -g -m -n + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"alpha"},"annotations":{"owner":"alice"}},"eTag":"43639614-5098-42b0-9729-39f92b5edbf2","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:39.0313184Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:39.0313184Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '627' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/c3b4f6da-7b10-4ddc-a8da-37183fb8b22a + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 84047913CD3F46B49057F290368BF901 Ref B: CO1AA3060818029 Ref C: 2026-08-06T16:59:41Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace list + Connection: + - keep-alive + ParameterSetName: + - -g -m + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces?api-version=2026-05-02-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"alpha"},"annotations":{"owner":"alice"}},"eTag":"43639614-5098-42b0-9729-39f92b5edbf2","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:39.0313184Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:39.0313184Z"}}],"nextLink":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces?api-version=2026-05-02-preview\u0026$skipToken=1\u0026skipToken=1"}' + headers: + cache-control: + - no-cache + content-length: + - '899' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/2f7ff136-2f1d-47af-8519-127a02ab3690 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C4FB5AB8B48E42C89BB16A46AB07A265 Ref B: MWH011020808060 Ref C: 2026-08-06T16:59:41Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace list + Connection: + - keep-alive + ParameterSetName: + - -g -m + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces?api-version=2026-05-02-preview&$skipToken=1&skipToken=1 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/83d3a5ff-58a7-4374-b262-59a301d7e44e + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: B1768BC2473C4345A9B6CDC9E20F90F8 Ref B: MWH011020808042 Ref C: 2026-08-06T16:59:41Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace update + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"alpha"},"annotations":{"owner":"alice"}},"eTag":"43639614-5098-42b0-9729-39f92b5edbf2","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:39.0313184Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:39.0313184Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '627' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/7d48633d-f136-4c4b-901d-3eb846decf7a + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: DDC1AA81F75D4ACEB2D492E69361373B Ref B: CO1AA3060813023 Ref C: 2026-08-06T16:59:42Z' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"labels": {"team": "beta"}, "annotations": {"owner": "bob"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace update + Connection: + - keep-alive + Content-Length: + - '77' + Content-Type: + - application/json + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Updating","labels":{"team":"beta"},"annotations":{"owner":"bob"}},"eTag":"5371cfbc-7e4f-4736-b72a-0a6193212c9e","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:42.7938079Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:42.7938079Z"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/0a36da0a-3597-4794-98fa-fa841097b2c1?api-version=2025-10-01&t=639216323829500552&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkD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ZserlQTQG1e7u-Z7UEl&s=teqK0LTVLS0Nb7jOLdyh8c9j-CoR9q77m97OiGCzZ5resN_qsREOvdt-SWLBYsh3q9U0TUqmSdk8bYnCatzXCQdgVUDkitDcsPEgQ14uFFduZIaIA443EfvFLe_mNP97Nev_VAyjd70kvG_YP5jYzxLbD-9VEvpg5tb3Augg2gGcKTwZvklkFTv8zvWs9OpbabjqYVvPrHpnx3gnuYXKMtwTKc1bNrVX1Z4PvzYahtMwGUMGnYXjI5r-PBpbxnbiWpOgUSDV2yUpdW1euUTlHBX14PlpoEqGXyge460OV4KUscnlIRgkb0K06umCaCm59y-onlQsFhUe_31iOx_QYg&h=ORMpznp3Pn7o_i26bjUNm7hFxZvCwl_KeU8nMTR8RQs + cache-control: + - no-cache + content-length: + - '623' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/1e3ccb46-d59f-472b-adc3-d25f50cf8f40 + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 25C351FC0F2144ABBAB096E2801B2803 Ref B: CO1AA3060813062 Ref C: 2026-08-06T16:59:42Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace update + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/0a36da0a-3597-4794-98fa-fa841097b2c1?api-version=2025-10-01&t=639216323829500552&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIwDAYDVR0TAQH_BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH_BAQDAgWgMB0GA1UdDgQWBBQZbVl_wKnmyxn5O2JcAqCDdV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J0cy9jY21lY2VudHJhbHVzcGtpL2NjbWVjZW50cmFsdXNpY2EwMS9jZXJ0LmNlcjBsBggrBgEFBQcwAoZgaHR0cDovL2NjbWVjZW50cmFsdXNwa2kuY2VudHJhbHVzLnBraS5jb3JlLndpbmRvd3MubmV0L2NlcnRpZmljYXRlQXV0aG9yaXRpZXMvY2NtZWNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=teqK0LTVLS0Nb7jOLdyh8c9j-CoR9q77m97OiGCzZ5resN_qsREOvdt-SWLBYsh3q9U0TUqmSdk8bYnCatzXCQdgVUDkitDcsPEgQ14uFFduZIaIA443EfvFLe_mNP97Nev_VAyjd70kvG_YP5jYzxLbD-9VEvpg5tb3Augg2gGcKTwZvklkFTv8zvWs9OpbabjqYVvPrHpnx3gnuYXKMtwTKc1bNrVX1Z4PvzYahtMwGUMGnYXjI5r-PBpbxnbiWpOgUSDV2yUpdW1euUTlHBX14PlpoEqGXyge460OV4KUscnlIRgkb0K06umCaCm59y-onlQsFhUe_31iOx_QYg&h=ORMpznp3Pn7o_i26bjUNm7hFxZvCwl_KeU8nMTR8RQs + response: + body: + string: "{\n \"name\": \"0a36da0a-3597-4794-98fa-fa841097b2c1\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2026-08-06T16:59:42.8602131Z\",\n \"endTime\": + \"2026-08-06T16:59:43.3187315Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '165' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:43 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/e3149b97-0a68-43fd-86d1-604dcbd2f037 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 0EE646FF16EA4886AD6A1A9B9E47CA2D Ref B: MWH011020807029 Ref C: 2026-08-06T16:59:43Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace update + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --labels --annotations + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"beta"},"annotations":{"owner":"bob"}},"eTag":"328d44ad-7113-4d3b-9874-f92c03d5a1f7","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:42.7938079Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:42.7938079Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:43 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/9fc223f8-d0a0-49ff-96aa-b149afe220fe + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 46CBB438DEA4494FA644A9887249F5ED Ref B: CO6AA3150220021 Ref C: 2026-08-06T16:59:44Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace delete + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003","name":"aimns000003","type":"Microsoft.ContainerService/aiManagers/namespaces","properties":{"provisioningState":"Succeeded","labels":{"team":"beta"},"annotations":{"owner":"bob"}},"eTag":"328d44ad-7113-4d3b-9874-f92c03d5a1f7","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:59:42.7938079Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:42.7938079Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/74e1c506-4227-4792-98a3-033a917834d3 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 50E0A1AFB8AF4AF2A2834D43E55C7785 Ref B: CO6AA3150218011 Ref C: 2026-08-06T16:59:44Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -m -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002/namespaces/aimns000003?api-version=2026-05-02-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/1b035afe-13af-42f6-b435-68c80bf17647?api-version=2025-10-01&t=639216323852722717&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaW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MAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=V6L9BDun-uHzEHa8XP2R2A-nTvt9MUfi4DgZu2GToPNQJL93C1IQtdx1Dr1b9dp7AmQQJ5eam4A7gHk80IZRd1FBapxan-osZ3F1SgJSjsl67NZf866Je4I7uFpiFQBhHWQ-ayTMyZvU-uhepwXYApiEAWydqEMhN-lhLRIGtYeTG_lQxq9DHO9Y9uzXUK8LN44l1qdrlIa1hFLuf8E1_Cvljk1Ag91IcDF3n2pl6cblkSOD9TkG3S4ncfV6Oh30suvdiu542NseqdE4dZ40PZHSyPQuL984yEbi5M0ig4t3whHfv3Np-wTmJfRJN4FDNr0UdywGgo0fmP4og09nIQ&h=Azqy0Ekcz4eub9NL2ARipdvuHUy7_l-VKXUoGT5qLqk + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:44 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operationresults/1b035afe-13af-42f6-b435-68c80bf17647?api-version=2025-10-01&t=639216323852878856&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaW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CBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=tnBkoGaN_k1_Q-UqGXIJmVB90_S5J8cp_qbenppCUyyy5bJQEIVIYl5ioBF29EgBf6degD3aoa55ZXLIFufdGLDet-Z3Kt0tS7IXAW7zMqebi7awrf-gUs-jKx2TDcm5HKg2fIhw5eFeMm2btp8hFUPVW_9XvcZl_XrJk0VKCqdfE4a2a18wt9D0L7Q15dFf1CDvNu5_Buj4inDLOJ9OEWyZtlWA-QgWgQN_7sPzFFgZ_jy5x8Yw7Y5pJcsyQmuxbo7fWsia2GwEoHxJZy93mj0kXCShLvaJQEVT-6Sjf8TW6zOLL1SkRIKoLCnByS2cylAk4EI3amEmMopyQzUniA&h=yPQPz6av_HzYW5EKz985_9foK7JUDBjvL-_T3b7i13g + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/8360ad1d-d3c6-4fee-80af-eb47cb47cdad + x-ms-ratelimit-remaining-subscription-deletes: + - '799' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '11999' + x-msedge-ref: + - 'Ref A: FEE6DE7AA3F0492C9949233614187451 Ref B: MWH011020807036 Ref C: 2026-08-06T16:59:44Z' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager namespace delete + Connection: + - keep-alive + ParameterSetName: + - -g -m -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/1b035afe-13af-42f6-b435-68c80bf17647?api-version=2025-10-01&t=639216323852722717&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMA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0ig4t3whHfv3Np-wTmJfRJN4FDNr0UdywGgo0fmP4og09nIQ&h=Azqy0Ekcz4eub9NL2ARipdvuHUy7_l-VKXUoGT5qLqk + response: + body: + string: "{\n \"name\": \"1b035afe-13af-42f6-b435-68c80bf17647\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2026-08-06T16:59:45.1604685Z\",\n \"endTime\": + \"2026-08-06T16:59:45.9453109Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '165' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/14480466-53d4-4a3f-bca6-ae8f80f2de4e + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 7646094BFD63470A9B2B3E5BE313EDDE Ref B: MWH011020809052 Ref C: 2026-08-06T16:59:45Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002","name":"aim000002","type":"Microsoft.ContainerService/aiManagers","location":"eastus2","tags":{"env":"test","team":"alpha"},"properties":{"provisioningState":"Succeeded","deletePolicy":"Delete","managedResourceGroupName":"AIM_cli-aimgr-000001_aim000002_eastus2"},"eTag":"fbefcefa-ef80-4768-8223-6e10397eda7c","systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-08-06T16:50:19.4574062Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-08-06T16:59:06.5150863Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '683' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 0126D0A7D76A4F7FB294BF1AEC2BC419 Ref B: MWH011020809031 Ref C: 2026-08-06T16:59:46Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-aimgr-000001/providers/Microsoft.ContainerService/aiManagers/aim000002?api-version=2026-05-02-preview + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VT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ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + cache-control: + - no-cache + content-length: + - '0' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:47 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operationresults/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323876036427&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2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WNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=qDYGCvDfcqAteWzm7m3zuKuPhmbjMQDTZLy2Wf5boxySIKYynR_EaiTNENJLKPNCJF03SHRGZtTiCP2JaXzW4hsHk4cv8Y5WCiRY0mTbgXaaoJBjVCwW7BASllFpR9dtwgtxZi6NSztrILfWVS0nBJMHm_FEpPxV4CBBfIGXCuJstdVUFatAaldeSJG0L-2Sgvx8VsPYPbAUKTuxMI304KAH8ojj9DR_JC8Y8z1LpUBGaIxEA4QMT6o1ihOxgnbNDf1jfdSpgZzX4jVqFurbcUyGy5odT_wddi8uiFe8QkSXdF7pEwgG0Dv2NF7L1jed5Jteh3pdPBQTt7udYKyTTw&h=aO-D9f3dWtA7V_pxekNPCXOu514do6a9h17JrkCZj-8 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/eastus2/a3e1fede-c0ff-4b09-aa0c-a95457d47bf1 + x-ms-ratelimit-remaining-subscription-deletes: + - '799' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '11999' + x-msedge-ref: + - 'Ref A: A98851AFFF2B4F428605FB7CBFA78A7C Ref B: CO1AA3060817054 Ref C: 2026-08-06T16:59:46Z' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisG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VZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 16:59:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/af26df9d-e1e1-4695-b60b-0094c6f9ed61 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 6A9082DDAD274DB8B632F93756FFF180 Ref B: MWH011020807040 Ref C: 2026-08-06T16:59:47Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTE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ndpbmRvd3MubmV0L2NlcnRpZmljYXRlQXV0aG9yaXRpZXMvY2NtZWNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:00:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/25b0db3d-1732-4c04-abcf-364371841259 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 9D233EDE2D464C5B923FD3B49DD6D0CB Ref B: CO1AA3060819062 Ref C: 2026-08-06T17:00:18Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJN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&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:00:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/efd4340f-0961-4c3e-8a3b-7ad6e715351b + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: B3EE14674DD041C7A480B3FE452BA2B2 Ref B: CO1AA3060815060 Ref C: 2026-08-06T17:00:49Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIwDAYDVR0TAQH_BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDgYDVR0PAQH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+ \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:01:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/b00a3d9f-2208-4ca5-89d5-d533d285ba20 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: E60ED47B35B643A99C18DF4C50B7E703 Ref B: MWH011020806054 Ref C: 2026-08-06T17:01:19Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK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M3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:01:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/eef69edf-3b35-43f2-bff2-25fcaffdeb70 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 6D9F58F5AE874074BDE94C7AF5C5DB6C Ref B: MWH011020807042 Ref C: 2026-08-06T17:01:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQA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CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:02:21 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/403ef7b7-ad23-4af8-bae6-c10671a93325 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 3B77C19A918B4823AA6958D8F9B573DB Ref B: MWH011020807023 Ref C: 2026-08-06T17:02:21Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTI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ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:02:52 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/2789c42c-9515-4be6-b1d1-44eeb7ef03bd + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: DF2A991A1D524FB4A9C34625353ED3B1 Ref B: CO1AA3060820031 Ref C: 2026-08-06T17:02:52Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sU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g-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:03:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/d62249fc-17cd-456d-bfe9-3398a42ad9ef + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 78821A0ECE2A424AAAA154B92A0E6732 Ref B: CO1AA3060817054 Ref C: 2026-08-06T17:03:22Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/loc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udHJhbHVzcGtpL2NjbWVjZW50cmFsdXNpY2EwMS9jZXJ0LmNlcjBsBggrBgEFBQcwAoZgaHR0cDovL2NjbWVjZW50cmFsdXNwa2kuY2VudHJhbHVzLnBraS5jb3JlLndpbmRvd3MubmV0L2NlcnRpZmljYXRlQXV0aG9yaXRpZXMvY2NtZWNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:03:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/5a911a60-b77f-4fa2-ab4e-6352fd910d3e + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 7351B1F7288D45AF9459C2D6F73EAAE7 Ref B: CO1AA3060813025 Ref C: 2026-08-06T17:03:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbd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rBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:04:23 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/a6104ce9-a23d-4c43-9ee2-a10c8cd8a4d4 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 9A8DC77AD54C488B96BD2B2F4A970BF1 Ref B: MWH011020809054 Ref C: 2026-08-06T17:04:24Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1A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M_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:04:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/6eeeb365-50e5-4b84-9cab-63a5ff66f7fe + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 16D6516C77494FFAB22E8FC2E2C5F0B2 Ref B: CO1AA3060813054 Ref C: 2026-08-06T17:04:54Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2M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QTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:05:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/a8047595-25d7-4be6-8d5e-dda8597f3909 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: CFE3B910CEF040C0AF46888FA88A2763 Ref B: CO6AA3150219039 Ref C: 2026-08-06T17:05:25Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdA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Ro2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:05:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/55a6ab23-ba1c-4b57-8680-8c3c1dca551e + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: A983CA3FE3544E5DA13E7CBE74D5C4A4 Ref B: CO6AA3150219021 Ref C: 2026-08-06T17:05:56Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025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J0LmNlcjBsBggrBgEFBQcwAoZgaHR0cDovL2NjbWVjZW50cmFsdXNwa2kuY2VudHJhbHVzLnBraS5jb3JlLndpbmRvd3MubmV0L2NlcnRpZmljYXRlQXV0aG9yaXRpZXMvY2NtZWNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:06:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/93486488-0901-4515-8997-4168af3c4691 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 1CD9C19061F1494E9C7E6FD738F45727 Ref B: MWH011020809034 Ref C: 2026-08-06T17:06:27Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_i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RKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:06:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/2747177a-95c6-424e-bc64-8caa964d4d77 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 271EC098BE304BB587E8FAFEAA627810 Ref B: CO6AA3150217039 Ref C: 2026-08-06T17:06:57Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisGAQQBgjd7AQEwZgYKKwYBBAGCN3sCAjBYMFYGCCsGAQUFBwICMEoeSAAzADMAZQAwADEAOQAyADEALQA0AGQANgA0AC0ANABmADgAYwAtAGEAMAA1ADUALQA1AGIAZABhAGYAZgBkADUAZQAzADMAZDAMBgorBgEEAYI3ewMCMAwGCisGAQQBgjd7BAIw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xNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:07:28 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/2e333955-f14c-44d1-a816-72dd01ff6ba8 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: FABF6677948844A7BCE8B7DEFE375337 Ref B: CO1AA3060819025 Ref C: 2026-08-06T17:07:28Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYW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PrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:08:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/ec888c43-4387-43ee-bb4b-af090deea72a + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: FA19776FF9AF4629A6ECC077C76360F9 Ref B: MWH011020809029 Ref C: 2026-08-06T17:08:00Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQAwNTEzMDEGA1UEAxMqQ0NNRSBHMSBUTFMgUlNBIDIwNDggU0hBMjU2IDIwNDkgQ1VTIENBIDAxMB4XDTI2MDQwODAwMDQ1MloXDTI2MTAwMzA2MDQ1MlowQDE-MDwGA1UEAxM1YXN5bmNvcGVyYXRpb25zaWduaW5nY2VydGlmaWNhdGUubWFuYWdlbWVudC5henVyZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDT3FOWry_6qK0dbuwtMK4T4HuDo_lxyL6jb91_Fr1VWY_VRVB7zp7HCgghkwofjjGAbbdIqDseNKJdMcooubZaRzrViDXEgbnaN8vC-4cZ4fjDUhtZh80l4sEyp_iBCPcY7I-xDOLiz7i1vlpvCL7tA0iKHuk6AAPDQk4fPmFWUwUWR3SajkDmuQjTPVWhQyEOJVGJNf6hvyBKFjGuXqSOk8prQb8yn6q8TftPg2b9zjlfxfHQEZqdePVaY7VeW2ljF2sUmWsNvQikg3g_Zh9I6j0tT0DW51c8CoF8PrVglMgLQVrYCdAeE30Fi0vIiXCT0XOP-0RYInckGEJqDB8JAgMBAAGjggTCMIIEvjCBnQYDVR0gBIGVMIGSMAwGCisG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VZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '122' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:08:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/3a8dc497-1401-4a42-9bbf-dab6f2ff7d89 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 51B43E2CD432469B88F1BFE65FD4F170 Ref B: CO6AA3150219047 Ref C: 2026-08-06T17:08:30Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aimanager delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.89.0 (DOCKER) azsdk-python-core/1.39.0 Python/3.12.9 (Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.38) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus2/operations/588918d2-6ad7-41b8-90fd-468154c06a34?api-version=2025-10-01&t=639216323875723914&c=MIIHxDCCBqygAwIBAgIRAJbrgketDbWHLEx1EpPCeH4wDQYJKoZIhvcNAQELBQ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b3JlLndpbmRvd3MubmV0L2NlcnRpZmljYXRlQXV0aG9yaXRpZXMvY2NtZWNlbnRyYWx1c2ljYTAxMA0GCSqGSIb3DQEBCwUAA4IBAQCJKCm8sITuRyQTfwfcPh1P_Y_FIoUY5rZqcJP5tAOTOk1M7UmZj3IhXCBuZfq1T1jLPVgMAAzHcyE4XjPrHalXdgSI6SJ0gq8I0X_ncsTkhomAsA5RU_sucWZ9nWgbXX-QDJi_bM0mzxsaKErSi607X1BM3DqI2SNMMgk6r2Ez8s8_vw6HLIGw7rLHx2D1muwevYyZ0dVgJa-VHCrBoSBL_ytZIofR5WUtbICE_9YIipUuxbnIRg9Vo_fv4cLzx0uLFk32vRKMroJ_zkJageE_exU-hNqZc7DSsWkROInmq7mMmyBvpTZB-q5PrEYUJi9zJZserlQTQG1e7u-Z7UEl&s=oMJkdypycZbMAkPTHQtt3ut-e3rqXpih0gPP5sl76OhmIWvKsP7zIAGoK6Lwg-NBid7eej9veDBJMttcwEgr0ymICdOQr8wzWx__zQJNDDuIU64eRo2ijBp5vuC6hnAhKa71Qdp46yPGxWNv9ltDxu2hJ9OZLtYxK5gYkTOItfYkpLsE7gWXoFL05OjVZlb9omJAdVXFHARemzfbcqe9nG2wUy--KJobU_QzQ7LWztgRUNmD-ddveiYbHDAcR_CzhELQPu5oOrNDueJ9QI4g1e9Vfjl_RLoajeiRnVwhUkMsOY7OFhM_pLHmrZdwfVlp28W8Q3hL81F_favpd113CQ&h=AtpmyQm2wshVMhrI4Yg7GbgU9XDxNW7_dzrPODC4NRQ + response: + body: + string: "{\n \"name\": \"588918d2-6ad7-41b8-90fd-468154c06a34\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2026-08-06T16:59:47.5018851Z\",\n \"endTime\": + \"2026-08-06T17:08:39.2655141Z\"\n}" + headers: + cache-control: + - no-cache + content-length: + - '165' + content-type: + - application/json + date: + - Thu, 06 Aug 2026 17:09:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=f9c85099-3ba6-4765-85fc-b1d5dcfd3b77/westus2/e4349d0a-6c02-4b42-959d-d7cd9aa3aa74 + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: D1A2658E582641B78935338B3DD66C57 Ref B: CO1AA3060818025 Ref C: 2026-08-06T17:09:02Z' + status: + code: 200 + message: OK +version: 1 From 18dfc00c1c0ab922dd07c61cbee021e96725919c Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Fri, 7 Aug 2026 16:19:42 +0000 Subject: [PATCH 09/11] Add aimanager entry to service_name.json The CI "azdev linter/style on Modified Extensions" checks verify every extension high-level command has an entry in src/service_name.json. Add the `az aimanager` mapping to fix the failing service-name verification. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/service_name.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/service_name.json b/src/service_name.json index e2d64bd2d29..2e80755df7f 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -29,6 +29,11 @@ "AzureServiceName": "AI Examples", "URL": "https://learn.microsoft.com/ai/" }, + { + "Command": "az aimanager", + "AzureServiceName": "Kubernetes Service (AKS)", + "URL": "https://learn.microsoft.com/azure/aks" + }, { "Command": "az aks", "AzureServiceName": "Kubernetes Service (AKS)", From bfd85b2cf83e2022dd44286226dc4f7dc8b6bd83 Mon Sep 17 00:00:00 2001 From: Ximeng Zhao <112792872+xmzhao0822@users.noreply.github.com> Date: Fri, 7 Aug 2026 11:55:18 -0700 Subject: [PATCH 10/11] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/aimanager/azext_aimanager/_validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aimanager/azext_aimanager/_validators.py b/src/aimanager/azext_aimanager/_validators.py index 05563cbe378..753373023d2 100644 --- a/src/aimanager/azext_aimanager/_validators.py +++ b/src/aimanager/azext_aimanager/_validators.py @@ -8,7 +8,7 @@ def validate_ai_manager_name(namespace): if namespace.ai_manager_name is not None and not namespace.ai_manager_name.strip(): - raise InvalidArgumentValueError("--name/-n is not a valid AI Manager name.") + raise InvalidArgumentValueError("AI Manager name must not be empty.") def validate_namespace_name(namespace): From 38e19920b27c5ff20e3ef06c5ee39476b0de7e81 Mon Sep 17 00:00:00 2001 From: ximeng zhao Date: Fri, 7 Aug 2026 20:07:00 +0000 Subject: [PATCH 11/11] Scope --aks-custom-headers to aimanager create/update only Move the aks_custom_headers argument out of the group-level context into the create/update (and namespace add/update) scopes, so the flag is only exposed on the commands that actually plumb it into request headers. Addresses PR review feedback about the argument being accepted but unused on show/list/delete/wait. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/aimanager/azext_aimanager/_params.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aimanager/azext_aimanager/_params.py b/src/aimanager/azext_aimanager/_params.py index 92f9d70feb2..48d22391bdb 100644 --- a/src/aimanager/azext_aimanager/_params.py +++ b/src/aimanager/azext_aimanager/_params.py @@ -24,14 +24,14 @@ def load_arguments(self, _): validator=validate_ai_manager_name, help='The name of the AI Manager resource.', completer=get_resource_name_completion_list('Microsoft.ContainerService/aiManagers')) - c.argument('aks_custom_headers', options_list=['--aks-custom-headers'], - help='Comma-separated key=value pairs to specify custom headers.') for scope in ['aimanager create', 'aimanager update']: with self.argument_context(scope) as c: c.argument('tags', arg_type=tags_type, help='The tags to set to the AI Manager.') c.argument('delete_policy', arg_type=get_enum_type(DELETE_POLICIES), help='Delete options of the AI Manager. Defaults to Delete.') + c.argument('aks_custom_headers', options_list=['--aks-custom-headers'], + help='Comma-separated key=value pairs to specify custom headers.') with self.argument_context('aimanager create') as c: c.argument('location', arg_type=get_location_type(self.cli_ctx)) @@ -46,8 +46,6 @@ def load_arguments(self, _): c.argument('namespace_name', options_list=['--name', '-n'], validator=validate_namespace_name, help='The name of the AI Manager namespace.') - c.argument('aks_custom_headers', options_list=['--aks-custom-headers'], - help='Comma-separated key=value pairs to specify custom headers.') for scope in ['aimanager namespace add', 'aimanager namespace update']: with self.argument_context(scope) as c: @@ -55,3 +53,5 @@ def load_arguments(self, _): help='Space-separated labels (key=value) applied to the Kubernetes namespace.') c.argument('annotations', nargs='*', validator=validate_annotations, help='Space-separated annotations (key=value) applied to the Kubernetes namespace.') + c.argument('aks_custom_headers', options_list=['--aks-custom-headers'], + help='Comma-separated key=value pairs to specify custom headers.')