From 90ba1297bc6f86c9d209c58c91bbab79195b0a8d Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 28 Jul 2025 09:56:39 +0530 Subject: [PATCH 1/9] added --- .../workload_orchestration/solution_template/_create.py | 3 +++ .../aaz/latest/workload_orchestration/target/_create.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py index 528572999a0..8b960e8aace 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py @@ -67,6 +67,7 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--capabilities"], arg_group="Properties", help="List of capabilities", + required=True, ) _args_schema.description = AAZStrArg( options=["--description"], @@ -92,11 +93,13 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema.configurations = AAZFileArg( options=["--config-template-file","--configuration-template-file","-f"], help="Link to File containing Config expressions for this solution version", + required=False, ) _args_schema.specification = AAZFreeFormDictArg( options=["--specification"], help="App components spec, use @ to load from file", + required=True, ) _args_schema.enable_external_validation = AAZBoolArg( diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py index aa1dd32ad04..3631bf9ccd6 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py @@ -77,16 +77,22 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--description"], arg_group="Properties", help="Description of target", + required=True, + ) _args_schema.display_name = AAZStrArg( options=["--display-name"], arg_group="Properties", help="Display name of target", + required=True, + ) _args_schema.hierarchy_level = AAZStrArg( options=["--hierarchy-level"], arg_group="Properties", help="Hierarchy Level", + required=True, + ) _args_schema.solution_scope = AAZStrArg( options=["--solution-scope"], @@ -107,6 +113,8 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--target-specification"], arg_group="Properties", help="Specifies that we are using Helm charts for the k8s deployment", + required=True, + ) capabilities = cls._args_schema.capabilities From f1d317773bf897ffb3fa1ca9b60ae4618e234ce5 Mon Sep 17 00:00:00 2001 From: Atharva Date: Fri, 1 Aug 2025 14:51:43 +0530 Subject: [PATCH 2/9] commit --- .../context/__init__.py | 1 + .../context/_use_context.py | 177 ++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py index 97c8485d1f0..fa1b2c760bb 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py @@ -20,3 +20,4 @@ from ._show import * # from ._update import * from ._wait import * +from ._use_context import * diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py new file mode 100644 index 00000000000..c92881695d3 --- /dev/null +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py @@ -0,0 +1,177 @@ +# -------------------------------------------------------------------------------------------- +# 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 * + +from azure.cli.core.azclierror import CLIInternalError + +@register_command( + "workload-orchestration context use", +) +class UseContext(AAZCommand): + """Use Context by name + :example: Use a Context + az workload-orchestration context use -n myContext -g myResourceGroup + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/contexts/{}", "2025-06-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.context_name = AAZStrArg( + options=["-n", "--name"], + help="The name of the Context.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$", + max_length=61, + min_length=3, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + options=["-g", "--resource-group"], + help="Name of resource group.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ContextsGet(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) + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + CURRENT_CONTEXT_ID = result.get('id') + return f"Successfully set current context to '{self.ctx.args.context_name}'" + + class ContextsGet(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.Edge/contexts/{contextName}", + **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( + "contextName", self.ctx.args.context_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group or "default", + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + + return cls._schema_on_200 + +class _UseContextHelper: + """Helper class for UseContext""" + +__all__ = ["UseContext"] From e62546bb47aa5c4895a726f70e2d5647147961a4 Mon Sep 17 00:00:00 2001 From: Atharva Date: Fri, 1 Aug 2025 14:58:45 +0530 Subject: [PATCH 3/9] Made Changes --- .../latest/workload_orchestration/context/_show.py | 2 ++ .../workload_orchestration/context/_use_context.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py index 086a6576a77..2ad04135414 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py @@ -61,6 +61,8 @@ def _build_arguments_schema(cls, *args, **kwargs): def _execute_operations(self): self.pre_operations() + print (f"Using context '{self.ctx.args.context_name}' in resource group '{self.ctx.args.resource_group}'") + self.ContextsGet(ctx=self.ctx)() self.post_operations() diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py index c92881695d3..66bc17bb47d 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py @@ -64,6 +64,7 @@ def _build_arguments_schema(cls, *args, **kwargs): def _execute_operations(self): self.pre_operations() + print (f"Using context '{self.ctx.args.context_name}' in resource group '{self.ctx.args.resource_group}'") self.ContextsGet(ctx=self.ctx)() self.post_operations() @@ -77,8 +78,14 @@ def post_operations(self): def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - CURRENT_CONTEXT_ID = result.get('id') + current_context_id = result.get('id') + if current_context_id: + self.ctx.cli_ctx.config.set_value( + 'workload_orchestration', 'context_id', current_context_id) + self.ctx.cli_ctx.config.set_value( + 'workload_orchestration', 'context_name', self.ctx.args.context_name.to_serialized_data()) + self.ctx.cli_ctx.config.set_value( + 'workload_orchestration', 'resource_group', self.ctx.args.resource_group.to_serialized_data()) return f"Successfully set current context to '{self.ctx.args.context_name}'" class ContextsGet(AAZHttpOperation): From 24dec6272b4dd32c90f38e98f636a581b55bf1e2 Mon Sep 17 00:00:00 2001 From: Atharva Date: Mon, 4 Aug 2025 10:50:32 +0530 Subject: [PATCH 4/9] Added change --- .../latest/workload_orchestration/target/_create.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py index 3631bf9ccd6..8be3b548367 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py @@ -9,6 +9,7 @@ # flake8: noqa from azure.cli.core.aaz import * +from azure.cli.core.azclierror import CLIInternalError @register_command( @@ -71,7 +72,6 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--context-id"], arg_group="Properties", help="ArmId of Context", - required=True, ) _args_schema.description = AAZStrArg( options=["--description"], @@ -166,7 +166,14 @@ def _execute_operations(self): @register_callback def pre_operations(self): - pass + # If context_id is not provided, try to get it from config + if not self.ctx.args.context_id: + context_id = self.ctx.cli_ctx.config.get('workload_orchestration', 'context_id') + print("Context ID" , context_id) + if context_id: + self.ctx.args.context_id = context_id + else: + raise CLIInternalError("No context-id provided and no default context found. Please provide --context-id or use 'az workload-orchestration context use' to set a default context.") @register_callback def post_operations(self): From 348944e7a7b19eee42238dd7b783e906843e7a2c Mon Sep 17 00:00:00 2001 From: Atharva Date: Tue, 5 Aug 2025 14:15:26 +0530 Subject: [PATCH 5/9] Made changes --- .../context/__init__.py | 2 + .../context/_current_context.py | 68 +++++++++++++++ .../context/_set_context.py | 83 +++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_current_context.py create mode 100644 src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py index fa1b2c760bb..0e2e5182419 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/__init__.py @@ -21,3 +21,5 @@ # from ._update import * from ._wait import * from ._use_context import * +from ._set_context import * +from ._current_context import * \ No newline at end of file diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_current_context.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_current_context.py new file mode 100644 index 00000000000..cac0a25e88d --- /dev/null +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_current_context.py @@ -0,0 +1,68 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + +@register_command( + "workload-orchestration context current", +) +class CurrentContext(AAZCommand): + """Show current context information + :example: Show current context + az workload-orchestration context current + """ + + _aaz_info = { + "version": "2025-06-01" + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + # No operations needed - just reading config + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + context_id = self.ctx.cli_ctx.config.get('workload_orchestration', 'context_id', None) + context_name = self.ctx.cli_ctx.config.get('workload_orchestration', 'context_name', None) + resource_group = self.ctx.cli_ctx.config.get('workload_orchestration', 'resource_group', None) + + if not context_id or not context_name or not resource_group: + return "No current context is set" + + return { + "contextId": context_id, + "name": context_name, + "resourceGroup": resource_group + } + +class _CurrentContextHelper: + """Helper class for CurrentContext""" + +__all__ = ["CurrentContext"] diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py new file mode 100644 index 00000000000..c68268cfb67 --- /dev/null +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py @@ -0,0 +1,83 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + +@register_command( + "workload-orchestration context set", +) +class SetContext(AAZCommand): + """Set current context using context ID + :example: Set a Context using ID + az workload-orchestration context set --id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Edge/contexts/myContext + """ + + _aaz_info = { + "version": "2025-06-01" + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + _args_schema = cls._args_schema + _args_schema.context_id = AAZStrArg( + options=["--id"], + help="The full resource ID of the Context.", + required=True + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + # Extract context name and resource group from ID + # ID format: /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Edge/contexts/{name} + context_id = self.ctx.args.context_id.to_serialized_data() + parts = context_id.split('/') + if len(parts) != 9 or parts[6] != 'Microsoft.Edge' or parts[7] != 'contexts': + raise CLIInternalError("Invalid context ID format") + + context_name = parts[8] + resource_group = parts[4] + + print(f"Setting context '{context_name}' from resource group '{resource_group}'") + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + context_id = self.ctx.args.context_id.to_serialized_data() + parts = context_id.split('/') + context_name = parts[8] + resource_group = parts[4] + + self.ctx.cli_ctx.config.set_value('workload_orchestration', 'context_id', context_id) + self.ctx.cli_ctx.config.set_value('workload_orchestration', 'context_name', context_name) + self.ctx.cli_ctx.config.set_value('workload_orchestration', 'resource_group', resource_group) + + return f"Successfully set current context using ID '{self.ctx.args.context_id}'" + +class _SetContextHelper: + """Helper class for SetContext""" + +__all__ = ["SetContext"] From 6cf5c0fa2a7c1775db07f756ae85eeb4dd03e851 Mon Sep 17 00:00:00 2001 From: Manaswita Chichili Date: Tue, 19 Aug 2025 14:20:29 +0530 Subject: [PATCH 6/9] List solution revisions and instances --- .../configuration/_config_show.py | 167 +++++++++- .../workload_orchestration/target/__init__.py | 4 +- .../target/_solution_instance_list.py | 214 +++++++++++++ .../target/_solution_revision_list.py | 288 ++++++++++++++++++ 4 files changed, 665 insertions(+), 8 deletions(-) create mode 100644 src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_instance_list.py create mode 100644 src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_revision_list.py diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/configuration/_config_show.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/configuration/_config_show.py index 8c4a83d2fa9..18b973d70c5 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/configuration/_config_show.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/configuration/_config_show.py @@ -77,17 +77,25 @@ def _build_arguments_schema(cls, *args, **kwargs): # help="The resource-specific properties for this resource.", # nullable=True, # ) + _args_schema.version = AAZStrArg( + options=["--version"], + help="The version of the solution to show configuration for. Defaults to 'version1' if not specified." + ) return cls._args_schema def _execute_operations(self): self.pre_operations() - config_name = str(self.ctx.args.level_name) - if len(config_name) > 18: - config_name = config_name[:18] + "Config" + version = self.ctx.args.version + if version is not None and str(version).lower() != "undefined": + self.SolutionRevisionGet(ctx=self.ctx)() else: - config_name = config_name + "Config" - self.ctx.args.level_name = config_name - self.SolutionsGet(ctx=self.ctx)() + config_name = str(self.ctx.args.level_name) + if len(config_name) > 18: + config_name = config_name[:18] + "Config" + else: + config_name = config_name + "Config" + self.ctx.args.level_name = config_name + self.SolutionsGet(ctx=self.ctx)() self.post_operations() @register_callback @@ -101,7 +109,6 @@ def post_operations(self): def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) print(result["properties"]["values"]) - pass class SolutionsGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -259,7 +266,153 @@ def _build_schema_on_200(cls): tags.Element = AAZStrType() return cls._schema_on_200 + + class SolutionRevisionGet(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) + config = dict() + config["properties"] = dict() + config["properties"]["values"] = "{}" + if session.http_response.status_code in [404]: + self.ctx.set_var( + "instance", + config, + schema_builder=self._build_schema_on_404 + ) + else: + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/targets/{targetName}/solutions/{solutionName}/versions/{version}", + **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, + ), + **self.serialize_url_param( + "targetName", self.ctx.args.level_name if not str(self.ctx.args.level_name).endswith('Config') else str(self.ctx.args.level_name)[:-6], + required=True, + ), + **self.serialize_url_param( + "solutionName", self.ctx.args.solution_name, + required=True, + ), + **self.serialize_url_param( + "version", self.ctx.args.version, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + config = dict() + config["properties"] = dict() + config["properties"]["values"] = data.get("properties", {}).get("configuration", "") + self.ctx.set_var( + "instance", + config, + schema_builder=self._build_schema_on_200 + ) + + @classmethod + def _build_schema_on_404(cls): + cls._schema_on_200 = AAZObjectType() + _schema_on_200 = cls._schema_on_200 + _schema_on_200.properties = AAZFreeFormDictType() + return cls._schema_on_200 + + @classmethod + def _build_schema_on_200(cls): + cls._schema_on_200 = AAZObjectType() + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": False}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.properties.values = AAZStrType() + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 class _ShowHelper: """Helper class for Show""" diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/__init__.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/__init__.py index d37a346d059..13c2517b178 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/__init__.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/__init__.py @@ -21,4 +21,6 @@ from ._show import * from ._uninstall import * from ._update import * -from ._wait import * \ No newline at end of file +from ._wait import * +from ._solution_instance_list import * +from ._solution_revision_list import * \ No newline at end of file diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_instance_list.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_instance_list.py new file mode 100644 index 00000000000..1691a8e94bc --- /dev/null +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_instance_list.py @@ -0,0 +1,214 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "workload-orchestration target solution-instance-list", +) +class ListSolutionInstances(AAZCommand): + """List all solution instances of a solution deployed on a target + :example: + az workload-orchestration solution-instance list -g MyResourceGroup --solution-name MySolution + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/targets/{}/solutions/{}/instances", "2025-06-01"], + ] + } + + 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) + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.target_name = AAZStrArg( + options=["--target-name", "--name", "-n"], + help="Name of the target", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$", + max_length=61, + min_length=3, + ), + ) + _args_schema.solution_name = AAZStrArg( + options=["--solution-template-name", "--solution"], + help="Name of the solution", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$", + max_length=61, + min_length=3, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SolutionInstancesList(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 SolutionInstancesList(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.Edge/targets/{targetName}/solutions/{solutionName}/instances", + **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, + ), + **self.serialize_url_param( + "targetName", self.ctx.args.target_name, + required=True, + ), + **self.serialize_url_param( + "solutionName", self.ctx.args.solution_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + + properties = cls._schema_on_200.value.Element.properties + properties.state = AAZStrType() + properties.display_name = AAZStrType( + serialized_name="displayName", + ) + properties.created_at = AAZStrType( + serialized_name="createdAt", + ) + properties.updated_at = AAZStrType( + serialized_name="updatedAt", + ) + + return cls._schema_on_200 + + +class _ListSolutionInstancesHelper: + """Helper class for ListSolutionInstances""" + + +__all__ = ["ListSolutionInstances"] diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_revision_list.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_revision_list.py new file mode 100644 index 00000000000..a7540dc5594 --- /dev/null +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_revision_list.py @@ -0,0 +1,288 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "workload-orchestration target solution-revision-list", +) +class ListRevisions(AAZCommand): + """List all revisions of a solution deployed on a target + :example: + List all revisions of a solution on a target + az workload-orchestration target solution-revision-list -g MyResourceGroup --target-name MyTarget --solution-name MySolution + """ + + _aaz_info = { + "version": "2025-06-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.edge/targets/{}/solutions/{}/versions", "2025-06-01"], + ] + } + + 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( + required=True, + ) + _args_schema.target_name = AAZStrArg( + options=["--target-name", "--name", "-n"], + help="Name of the target", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$", + max_length=61, + min_length=3, + ), + ) + + # define Arg Group "Body" + + _args_schema.solution_name = AAZStrArg( + options=["--solution-template-name", "--solution"], + help="Name of the solution", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$", + max_length=61, + min_length=3, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TargetSolutionRevisionsList(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 TargetSolutionRevisionsList(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.Edge/targets/{targetName}/solutions/{solutionName}/versions", + **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, + ), + **self.serialize_url_param( + "targetName", self.ctx.args.target_name, + required=True, + ), + **self.serialize_url_param( + "solutionName", self.ctx.args.solution_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2025-06-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.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.extended_location = AAZObjectType( + serialized_name="extendedLocation", + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + extended_location = cls._schema_on_200.value.Element.extended_location + extended_location.name = AAZStrType() + extended_location.type = AAZStrType() + + properties = cls._schema_on_200.value.Element.properties + properties.configuration = AAZStrType() + properties.external_validation_id = AAZStrType( + serialized_name="externalValidationId", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.review_id = AAZStrType( + serialized_name="reviewId", + ) + properties.revision = AAZIntType() + properties.solution_dependencies = AAZListType( + serialized_name="solutionDependencies", + ) + properties.solution_instance_name = AAZStrType( + serialized_name="solutionInstanceName", + ) + properties.solution_template_version_id = AAZStrType( + serialized_name="solutionTemplateVersionId", + ) + properties.specification = AAZFreeFormDictType() + properties.state = AAZStrType() + properties.target_display_name = AAZStrType( + serialized_name="targetDisplayName", + ) + + solution_dependencies = cls._schema_on_200.value.Element.properties.solution_dependencies + solution_dependencies.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.solution_dependencies.Element + _element.dependencies = AAZListType() + _element.solution_instance_name = AAZStrType( + serialized_name="solutionInstanceName", + ) + _element.solution_template_version_id = AAZStrType( + serialized_name="solutionTemplateVersionId", + ) + _element.solution_version_id = AAZStrType( + serialized_name="solutionVersionId", + ) + _element.target_id = AAZStrType( + serialized_name="targetId", + ) + + dependencies = cls._schema_on_200.value.Element.properties.solution_dependencies.Element.dependencies + dependencies.Element = AAZObjectType() + + 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 _ListRevisionsHelper: + """Helper class for ListRevisions""" + + +__all__ = ["ListRevisions"] From 2ca1ede463683980555cd107a6a5c3860971f7e8 Mon Sep 17 00:00:00 2001 From: Atharva Date: Thu, 21 Aug 2025 09:24:44 +0530 Subject: [PATCH 7/9] Made changes rr --- .../aaz/latest/workload_orchestration/context/_set_context.py | 1 - .../aaz/latest/workload_orchestration/context/_show.py | 1 - .../aaz/latest/workload_orchestration/context/_use_context.py | 1 - .../aaz/latest/workload_orchestration/target/_create.py | 1 - 4 files changed, 4 deletions(-) diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py index c68268cfb67..4dd4a8ae82a 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_set_context.py @@ -54,7 +54,6 @@ def _execute_operations(self): context_name = parts[8] resource_group = parts[4] - print(f"Setting context '{context_name}' from resource group '{resource_group}'") self.post_operations() @register_callback diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py index 2ad04135414..f12c52f0d93 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_show.py @@ -61,7 +61,6 @@ def _build_arguments_schema(cls, *args, **kwargs): def _execute_operations(self): self.pre_operations() - print (f"Using context '{self.ctx.args.context_name}' in resource group '{self.ctx.args.resource_group}'") self.ContextsGet(ctx=self.ctx)() self.post_operations() diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py index 66bc17bb47d..4238d9fdf32 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_use_context.py @@ -64,7 +64,6 @@ def _build_arguments_schema(cls, *args, **kwargs): def _execute_operations(self): self.pre_operations() - print (f"Using context '{self.ctx.args.context_name}' in resource group '{self.ctx.args.resource_group}'") self.ContextsGet(ctx=self.ctx)() self.post_operations() diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py index 8be3b548367..31fc656e1fd 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py @@ -169,7 +169,6 @@ def pre_operations(self): # If context_id is not provided, try to get it from config if not self.ctx.args.context_id: context_id = self.ctx.cli_ctx.config.get('workload_orchestration', 'context_id') - print("Context ID" , context_id) if context_id: self.ctx.args.context_id = context_id else: From 34a8a042908943d4db062cd3e23b7b48b0e4ceeb Mon Sep 17 00:00:00 2001 From: Atharva Date: Thu, 21 Aug 2025 09:37:46 +0530 Subject: [PATCH 8/9] Made change --- .../latest/workload_orchestration/config_template/_create.py | 3 ++- .../aaz/latest/workload_orchestration/context/_create.py | 2 ++ .../aaz/latest/workload_orchestration/schema/_create.py | 1 + .../latest/workload_orchestration/solution_template/_create.py | 2 +- .../aaz/latest/workload_orchestration/target/_create.py | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/config_template/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/config_template/_create.py index f62083b3f40..70ae22677f8 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/config_template/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/config_template/_create.py @@ -101,7 +101,8 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema.configurations = AAZFileArg( options=["--config-template-file","--configuration-template-file"], - help="Link to File containing Config expressions for this config version" + help="Link to File containing Config expressions for this config version", + required=True ) return cls._args_schema diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_create.py index 338261e603d..5c3f2c6f810 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/context/_create.py @@ -65,11 +65,13 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--capabilities"], arg_group="Properties", help="List of Capabilities", + required=True ) _args_schema.hierarchies = AAZListArg( options=["--hierarchies"], arg_group="Properties", help="List of Hierarchies", + required=True ) capabilities = cls._args_schema.capabilities diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/schema/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/schema/_create.py index ec7a14382ef..57c594773f2 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/schema/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/schema/_create.py @@ -91,6 +91,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema.value = AAZFileArg( options=["--schema-file","-f"], help="Path to the schema file", + required=True ) tags = cls._args_schema.tags diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py index 8b960e8aace..612b8e73b9e 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/solution_template/_create.py @@ -93,7 +93,7 @@ def _build_arguments_schema(cls, *args, **kwargs): _args_schema.configurations = AAZFileArg( options=["--config-template-file","--configuration-template-file","-f"], help="Link to File containing Config expressions for this solution version", - required=False, + required=True, ) _args_schema.specification = AAZFreeFormDictArg( diff --git a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py index 31fc656e1fd..fa4da1477d6 100644 --- a/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py +++ b/src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_create.py @@ -67,6 +67,7 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--capabilities"], arg_group="Properties", help="List of capabilities", + required=True ) _args_schema.context_id = AAZResourceIdArg( options=["--context-id"], From 837a87f396157896df8bb1eff1bb5a2217480340 Mon Sep 17 00:00:00 2001 From: Atharva Date: Thu, 4 Sep 2025 09:32:22 +0530 Subject: [PATCH 9/9] Added change --- src/workload-orchestration/HISTORY.rst | 16 ++++++++++++++++ src/workload-orchestration/setup.py | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/workload-orchestration/HISTORY.rst b/src/workload-orchestration/HISTORY.rst index db9513b4891..534f14955e0 100644 --- a/src/workload-orchestration/HISTORY.rst +++ b/src/workload-orchestration/HISTORY.rst @@ -3,6 +3,22 @@ Release History =============== +3.0.0 +++++++ +* Added Context Management capabilities with new commands: + * ``az workload-orchestration context use`` - Set current context by name and resource group + * ``az workload-orchestration context set`` - Set current context using ARM resource ID + * ``az workload-orchestration context current`` - Display current context information +* Added Solution Management commands: + * ``az workload-orchestration target solution-instance-list`` - List all solution instances on a target + * ``az workload-orchestration target solution-revision-list`` - List all revisions of solutions on a target +* Enhanced Target creation with automatic context fallback to CLI configuration +* Added persistent context storage in CLI configuration +* Improved error handling with better messages for context-related operations +* Added automatic fallback to default context when context-id is not provided +* Enhanced context ID validation for better user experience +* Added --version parameter to ``az workload-orchestration configuration config show`` + 2.0.0 ++++++ * Added required context-id parameter to target create command diff --git a/src/workload-orchestration/setup.py b/src/workload-orchestration/setup.py index d5609c61baa..e527d759410 100644 --- a/src/workload-orchestration/setup.py +++ b/src/workload-orchestration/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '2.0.0' +VERSION = '3.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers