Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/managedcleanroom/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
===============

1.0.0b6
+++++++
* Update commands to reflect new API version 2026-04-30-preview
Comment thread
anrdesai marked this conversation as resolved.
* 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``

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT:

PUT -> PATCH on ``collaboration update``, ``consortium update``, ``consortium-view update``

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ._create import *
from ._delete import *
from ._enable_workload import *
from ._get_readonly_kube_config import *
from ._list import *
from ._pause import *
from ._recover import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class AddCollaborator(AAZCommand):
"""

_aaz_info = {
"version": "2026-03-31-preview",
"version": "2026-04-30-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/addcollaborator", "2026-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/addcollaborator", "2026-04-30-preview"],
]
}

Expand Down Expand Up @@ -163,7 +163,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2026-03-31-preview",
"api-version", "2026-04-30-preview",
required=True,
),
}
Expand Down Expand Up @@ -227,7 +227,7 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"required": True, "client_flatten": True},
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down Expand Up @@ -263,6 +263,9 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.resource_location = AAZStrType(
serialized_name="resourceLocation",
)
properties.workloads = AAZListType(
flags={"read_only": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2026-03-31-preview",
"version": "2026-04-30-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2026-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2026-04-30-preview"],
]
}

Expand Down Expand Up @@ -66,6 +66,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Properties",
help="Gets or sets the collaborators.",
)
_args_schema.resource_location = AAZStrArg(
options=["--resource-location"],
arg_group="Properties",
help="Gets or sets the resource location for the collaboration.",
)

collaborators = cls._args_schema.collaborators
collaborators.Element = AAZObjectArg()
Expand Down Expand Up @@ -194,7 +199,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2026-03-31-preview",
"api-version", "2026-04-30-preview",
required=True,
),
}
Expand All @@ -221,12 +226,13 @@ def content(self):
)
_builder.set_prop("kind", AAZStrType, ".kind")
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("collaborators", AAZListType, ".collaborators")
properties.set_prop("resourceLocation", AAZStrType, ".resource_location")

collaborators = _builder.get(".properties.collaborators")
if collaborators is not None:
Expand Down Expand Up @@ -273,7 +279,7 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType(
flags={"required": True, "client_flatten": True},
flags={"client_flatten": True},
)
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down Expand Up @@ -309,6 +315,9 @@ def _build_schema_on_200_201(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.resource_location = AAZStrType(
serialized_name="resourceLocation",
)
properties.workloads = AAZListType(
flags={"read_only": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2026-03-31-preview",
"version": "2026-04-30-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2026-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}", "2026-04-30-preview"],
]
}

Expand Down Expand Up @@ -147,7 +147,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2026-03-31-preview",
"api-version", "2026-04-30-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class EnableWorkload(AAZCommand):
"""

_aaz_info = {
"version": "2026-03-31-preview",
"version": "2026-04-30-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/enableworkload", "2026-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cleanroom/collaborations/{}/enableworkload", "2026-04-30-preview"],
]
}

Expand Down Expand Up @@ -67,7 +67,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Body",
help="Type of the workload to be enabled.",
required=True,
enum={"analytics": "analytics"},
enum={"Analytics": "Analytics"},
)
return cls._args_schema

Expand Down Expand Up @@ -152,7 +152,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2026-03-31-preview",
"api-version", "2026-04-30-preview",
required=True,
),
}
Expand Down Expand Up @@ -210,7 +210,7 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
_schema_on_200.properties = AAZObjectType(
flags={"required": True, "client_flatten": True},
flags={"client_flatten": True},
)
_schema_on_200.system_data = AAZObjectType(
serialized_name="systemData",
Expand Down Expand Up @@ -246,6 +246,9 @@ def _build_schema_on_200(cls):
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.resource_location = AAZStrType(
serialized_name="resourceLocation",
)
properties.workloads = AAZListType(
flags={"read_only": True},
)
Expand Down
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.
Comment thread
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"]
Loading
Loading