-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Azure Clean Room: CLI for 2026-04-30-preview #9848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
necusjz
merged 3 commits into
Azure:main
from
anrdesai:feature-managedcleanroom-2026-04-30
May 7, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,13 @@ | |
| Release History | ||
| =============== | ||
|
|
||
| 1.0.0b6 | ||
| +++++++ | ||
| * Update commands to reflect new API version 2026-04-30-preview | ||
| * Added: ``az managedcleanroom collaboration get-readonly-kube-config`` to fetch the read-only kubeconfig for a collaboration | ||
| * PUT -> PATCH on ``collaboration update``, ``consortium update``, ``consortium-view update`` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: This is not required. Whenever we auto-generate, it suggests PUT but it should be PATCH, something to fix at the TSP maybe. |
||
| * Restored ``PrivateEndpointUtil`` and rewired generated URLs through env-var driven namespace (``Microsoft.CleanRoom`` / ``Private.CleanRoom``) | ||
|
|
||
| 1.0.0b1 | ||
| +++++++ | ||
| * Initial release. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
171 changes: 171 additions & 0 deletions
171
...t_managedcleanroom/aaz/latest/managedcleanroom/collaboration/_get_readonly_kube_config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # 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 ..private_endpoint_util import PrivateEndpointUtil | ||
|
|
||
|
|
||
| @register_command( | ||
| "managedcleanroom collaboration get-readonly-kube-config", | ||
| ) | ||
| class GetReadonlyKubeConfig(AAZCommand): | ||
| """Gets the readonly kubeconfig for the collaboration. | ||
|
anrdesai marked this conversation as resolved.
|
||
|
|
||
| :example: Get Readonly KubeConfig for Collaboration | ||
| az managedcleanroom collaboration get-readonly-kube-config --resource-group testrg --collaboration-name ContosoCollaboration | ||
| """ | ||
|
|
||
| _aaz_info = { | ||
| "version": "2026-04-30-preview", | ||
| "resources": [ | ||
| ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/getreadonlykubeconfig", "2026-04-30-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.collaboration_name = AAZStrArg( | ||
| options=["--collaboration-name"], | ||
| help="Name of the collaboration.", | ||
| required=True, | ||
| id_part="name", | ||
| fmt=AAZStrArgFormat( | ||
| pattern="^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", | ||
| ), | ||
| ) | ||
| _args_schema.resource_group = AAZResourceGroupNameArg( | ||
| required=True, | ||
| ) | ||
| return cls._args_schema | ||
|
|
||
| def _execute_operations(self): | ||
| self.pre_operations() | ||
| self.CollaborationsGetReadonlyKubeConfig(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 CollaborationsGetReadonlyKubeConfig(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( | ||
| f"/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/{PrivateEndpointUtil.get_configured_namespace()}/collaborations/{{collaborationName}}/getReadonlyKubeConfig", | ||
| **self.url_parameters | ||
| ) | ||
|
|
||
| @property | ||
| def method(self): | ||
| return "POST" | ||
|
|
||
| @property | ||
| def error_format(self): | ||
| return "MgmtErrorFormat" | ||
|
|
||
| @property | ||
| def url_parameters(self): | ||
| parameters = { | ||
| **self.serialize_url_param( | ||
| "collaborationName", self.ctx.args.collaboration_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-30-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.kubeconfig = AAZStrType( | ||
| flags={"required": True}, | ||
| ) | ||
|
|
||
| return cls._schema_on_200 | ||
|
|
||
|
|
||
| class _GetReadonlyKubeConfigHelper: | ||
| """Helper class for GetReadonlyKubeConfig""" | ||
|
|
||
|
|
||
| __all__ = ["GetReadonlyKubeConfig"] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.