1616)
1717class List (AAZCommand ):
1818 """List all the hybrid machines in the specified subscription or resource group.
19+
20+ :example: sample command of list
21+ az connectedmachine list
1922 """
2023
2124 _aaz_info = {
22- "version" : "2024-07-31 -preview" ,
25+ "version" : "2024-11-10 -preview" ,
2326 "resources" : [
24- ["mgmt-plane" , "/subscriptions/{}/providers/microsoft.hybridcompute/machines" , "2024-07-31 -preview" ],
25- ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines" , "2024-07-31 -preview" ],
27+ ["mgmt-plane" , "/subscriptions/{}/providers/microsoft.hybridcompute/machines" , "2024-11-10 -preview" ],
28+ ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines" , "2024-11-10 -preview" ],
2629 ]
2730 }
2831
@@ -52,12 +55,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
5255
5356 def _execute_operations (self ):
5457 self .pre_operations ()
55- condition_0 = has_value (self .ctx .args . resource_group ) and has_value (self .ctx .subscription_id )
56- condition_1 = has_value (self .ctx .subscription_id ) and has_value (self .ctx .args . resource_group ) is not True
58+ condition_0 = has_value (self .ctx .subscription_id ) and has_value (self .ctx .args . resource_group ) is not True
59+ condition_1 = has_value (self .ctx .args . resource_group ) and has_value (self .ctx .subscription_id )
5760 if condition_0 :
58- self .MachinesListByResourceGroup (ctx = self .ctx )()
59- if condition_1 :
6061 self .MachinesListBySubscription (ctx = self .ctx )()
62+ if condition_1 :
63+ self .MachinesListByResourceGroup (ctx = self .ctx )()
6164 self .post_operations ()
6265
6366 @register_callback
@@ -73,7 +76,7 @@ def _output(self, *args, **kwargs):
7376 next_link = self .deserialize_output (self .ctx .vars .instance .next_link )
7477 return result , next_link
7578
76- class MachinesListByResourceGroup (AAZHttpOperation ):
79+ class MachinesListBySubscription (AAZHttpOperation ):
7780 CLIENT_TYPE = "MgmtClient"
7881
7982 def __call__ (self , * args , ** kwargs ):
@@ -87,7 +90,7 @@ def __call__(self, *args, **kwargs):
8790 @property
8891 def url (self ):
8992 return self .client .format_url (
90- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.HybridCompute/machines" ,
93+ "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines" ,
9194 ** self .url_parameters
9295 )
9396
@@ -102,10 +105,6 @@ def error_format(self):
102105 @property
103106 def url_parameters (self ):
104107 parameters = {
105- ** self .serialize_url_param (
106- "resourceGroupName" , self .ctx .args .resource_group ,
107- required = True ,
108- ),
109108 ** self .serialize_url_param (
110109 "subscriptionId" , self .ctx .subscription_id ,
111110 required = True ,
@@ -117,10 +116,7 @@ def url_parameters(self):
117116 def query_parameters (self ):
118117 parameters = {
119118 ** self .serialize_query_param (
120- "$expand" , self .ctx .args .expand ,
121- ),
122- ** self .serialize_query_param (
123- "api-version" , "2024-07-31-preview" ,
119+ "api-version" , "2024-11-10-preview" ,
124120 required = True ,
125121 ),
126122 }
@@ -816,7 +812,7 @@ def _build_schema_on_200(cls):
816812
817813 return cls ._schema_on_200
818814
819- class MachinesListBySubscription (AAZHttpOperation ):
815+ class MachinesListByResourceGroup (AAZHttpOperation ):
820816 CLIENT_TYPE = "MgmtClient"
821817
822818 def __call__ (self , * args , ** kwargs ):
@@ -830,7 +826,7 @@ def __call__(self, *args, **kwargs):
830826 @property
831827 def url (self ):
832828 return self .client .format_url (
833- "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines" ,
829+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.HybridCompute/machines" ,
834830 ** self .url_parameters
835831 )
836832
@@ -845,6 +841,10 @@ def error_format(self):
845841 @property
846842 def url_parameters (self ):
847843 parameters = {
844+ ** self .serialize_url_param (
845+ "resourceGroupName" , self .ctx .args .resource_group ,
846+ required = True ,
847+ ),
848848 ** self .serialize_url_param (
849849 "subscriptionId" , self .ctx .subscription_id ,
850850 required = True ,
@@ -856,7 +856,10 @@ def url_parameters(self):
856856 def query_parameters (self ):
857857 parameters = {
858858 ** self .serialize_query_param (
859- "api-version" , "2024-07-31-preview" ,
859+ "$expand" , self .ctx .args .expand ,
860+ ),
861+ ** self .serialize_query_param (
862+ "api-version" , "2024-11-10-preview" ,
860863 required = True ,
861864 ),
862865 }
0 commit comments