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
4 changes: 4 additions & 0 deletions src/connectedmachine/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
2.0.0b1
+++++
* 2024/11/10-preview is used for aaz generation. Migrated to aaz.

1.1.1b1
+++++
* Fix connectedmachine list command and set resource group as optional.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2024-07-31-preview",
"version": "2024-11-10-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-07-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-11-10-preview"],
]
}

Expand Down Expand Up @@ -124,7 +124,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
"api-version", "2024-11-10-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
)
class List(AAZCommand):
"""List all the hybrid machines in the specified subscription or resource group.

:example: sample command of list
az connectedmachine list
"""

_aaz_info = {
"version": "2024-07-31-preview",
"version": "2024-11-10-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.hybridcompute/machines", "2024-07-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines", "2024-07-31-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.hybridcompute/machines", "2024-11-10-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines", "2024-11-10-preview"],
]
}

Expand Down Expand Up @@ -52,12 +55,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

def _execute_operations(self):
self.pre_operations()
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
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.MachinesListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.MachinesListBySubscription(ctx=self.ctx)()
if condition_1:
self.MachinesListByResourceGroup(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -73,7 +76,7 @@ def _output(self, *args, **kwargs):
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link

class MachinesListByResourceGroup(AAZHttpOperation):
class MachinesListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -87,7 +90,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines",
"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines",
**self.url_parameters
)

Expand All @@ -102,10 +105,6 @@ def error_format(self):
@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,
Expand All @@ -117,10 +116,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
"api-version", "2024-11-10-preview",
required=True,
),
}
Expand Down Expand Up @@ -816,7 +812,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class MachinesListBySubscription(AAZHttpOperation):
class MachinesListByResourceGroup(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -830,7 +826,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines",
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines",
**self.url_parameters
)

Expand All @@ -845,6 +841,10 @@ def error_format(self):
@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,
Expand All @@ -856,7 +856,10 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-11-10-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class Show(AAZCommand):
"""

_aaz_info = {
"version": "2024-07-31-preview",
"version": "2024-11-10-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-07-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-11-10-preview"],
]
}

Expand Down Expand Up @@ -133,7 +133,7 @@ def query_parameters(self):
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-07-31-preview",
"api-version", "2024-11-10-preview",
required=True,
),
}
Expand Down
Loading
Loading