Skip to content

Commit 2eb9e5c

Browse files
committed
fix output & support azure stack
1 parent c3d5428 commit 2eb9e5c

File tree

25 files changed

+1147
-191
lines changed

25 files changed

+1147
-191
lines changed

src/azure-cli/azure/cli/command_modules/vm/_actions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ def _load_images_from_publisher(publisher):
130130
'offer': o['name'],
131131
'sku': s['name'],
132132
'version': i['name'],
133-
'architecture': i.get('additional_properties', {}).get("properties", {}).get("architecture", None) or "",
134-
'imageDeprecationStatus': i.get('additional_properties', {}).get(
135-
"properties", {}).get("imageDeprecationStatus", {}) or ""
133+
'architecture': i.get("properties", {}).get("architecture", None) or "",
134+
'imageDeprecationStatus': i.get("properties", {}).get("imageDeprecationStatus", {}) or ""
136135
}
137136
if edge_zone is not None:
138137
image_info['edge_zone'] = edge_zone

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/image/_list.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,92 @@ def _build_schema_on_200(cls):
196196
_element.name = AAZStrType(
197197
flags={"required": True},
198198
)
199+
_element.properties = AAZObjectType()
199200
_element.tags = AAZDictType()
200201

201202
extended_location = cls._schema_on_200.Element.extended_location
202203
extended_location.name = AAZStrType()
203204
extended_location.type = AAZStrType()
204205

206+
properties = cls._schema_on_200.Element.properties
207+
properties.architecture = AAZStrType()
208+
properties.automatic_os_upgrade_properties = AAZObjectType(
209+
serialized_name="automaticOSUpgradeProperties",
210+
)
211+
properties.data_disk_images = AAZListType(
212+
serialized_name="dataDiskImages",
213+
)
214+
properties.disallowed = AAZObjectType()
215+
properties.features = AAZListType()
216+
properties.hyper_v_generation = AAZStrType(
217+
serialized_name="hyperVGeneration",
218+
)
219+
properties.image_deprecation_status = AAZObjectType(
220+
serialized_name="imageDeprecationStatus",
221+
)
222+
properties.os_disk_image = AAZObjectType(
223+
serialized_name="osDiskImage",
224+
)
225+
properties.plan = AAZObjectType()
226+
227+
automatic_os_upgrade_properties = cls._schema_on_200.Element.properties.automatic_os_upgrade_properties
228+
automatic_os_upgrade_properties.automatic_os_upgrade_supported = AAZBoolType(
229+
serialized_name="automaticOSUpgradeSupported",
230+
flags={"required": True},
231+
)
232+
233+
data_disk_images = cls._schema_on_200.Element.properties.data_disk_images
234+
data_disk_images.Element = AAZObjectType()
235+
236+
_element = cls._schema_on_200.Element.properties.data_disk_images.Element
237+
_element.lun = AAZIntType(
238+
flags={"read_only": True},
239+
)
240+
241+
disallowed = cls._schema_on_200.Element.properties.disallowed
242+
disallowed.vm_disk_type = AAZStrType(
243+
serialized_name="vmDiskType",
244+
)
245+
246+
features = cls._schema_on_200.Element.properties.features
247+
features.Element = AAZObjectType()
248+
249+
_element = cls._schema_on_200.Element.properties.features.Element
250+
_element.name = AAZStrType()
251+
_element.value = AAZStrType()
252+
253+
image_deprecation_status = cls._schema_on_200.Element.properties.image_deprecation_status
254+
image_deprecation_status.alternative_option = AAZObjectType(
255+
serialized_name="alternativeOption",
256+
)
257+
image_deprecation_status.image_state = AAZStrType(
258+
serialized_name="imageState",
259+
)
260+
image_deprecation_status.scheduled_deprecation_time = AAZStrType(
261+
serialized_name="scheduledDeprecationTime",
262+
)
263+
264+
alternative_option = cls._schema_on_200.Element.properties.image_deprecation_status.alternative_option
265+
alternative_option.type = AAZStrType()
266+
alternative_option.value = AAZStrType()
267+
268+
os_disk_image = cls._schema_on_200.Element.properties.os_disk_image
269+
os_disk_image.operating_system = AAZStrType(
270+
serialized_name="operatingSystem",
271+
flags={"required": True},
272+
)
273+
274+
plan = cls._schema_on_200.Element.properties.plan
275+
plan.name = AAZStrType(
276+
flags={"required": True},
277+
)
278+
plan.product = AAZStrType(
279+
flags={"required": True},
280+
)
281+
plan.publisher = AAZStrType(
282+
flags={"required": True},
283+
)
284+
205285
tags = cls._schema_on_200.Element.tags
206286
tags.Element = AAZStrType()
207287

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/image/_list_offers.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,92 @@ def _build_schema_on_200(cls):
161161
_element.name = AAZStrType(
162162
flags={"required": True},
163163
)
164+
_element.properties = AAZObjectType()
164165
_element.tags = AAZDictType()
165166

166167
extended_location = cls._schema_on_200.Element.extended_location
167168
extended_location.name = AAZStrType()
168169
extended_location.type = AAZStrType()
169170

171+
properties = cls._schema_on_200.Element.properties
172+
properties.architecture = AAZStrType()
173+
properties.automatic_os_upgrade_properties = AAZObjectType(
174+
serialized_name="automaticOSUpgradeProperties",
175+
)
176+
properties.data_disk_images = AAZListType(
177+
serialized_name="dataDiskImages",
178+
)
179+
properties.disallowed = AAZObjectType()
180+
properties.features = AAZListType()
181+
properties.hyper_v_generation = AAZStrType(
182+
serialized_name="hyperVGeneration",
183+
)
184+
properties.image_deprecation_status = AAZObjectType(
185+
serialized_name="imageDeprecationStatus",
186+
)
187+
properties.os_disk_image = AAZObjectType(
188+
serialized_name="osDiskImage",
189+
)
190+
properties.plan = AAZObjectType()
191+
192+
automatic_os_upgrade_properties = cls._schema_on_200.Element.properties.automatic_os_upgrade_properties
193+
automatic_os_upgrade_properties.automatic_os_upgrade_supported = AAZBoolType(
194+
serialized_name="automaticOSUpgradeSupported",
195+
flags={"required": True},
196+
)
197+
198+
data_disk_images = cls._schema_on_200.Element.properties.data_disk_images
199+
data_disk_images.Element = AAZObjectType()
200+
201+
_element = cls._schema_on_200.Element.properties.data_disk_images.Element
202+
_element.lun = AAZIntType(
203+
flags={"read_only": True},
204+
)
205+
206+
disallowed = cls._schema_on_200.Element.properties.disallowed
207+
disallowed.vm_disk_type = AAZStrType(
208+
serialized_name="vmDiskType",
209+
)
210+
211+
features = cls._schema_on_200.Element.properties.features
212+
features.Element = AAZObjectType()
213+
214+
_element = cls._schema_on_200.Element.properties.features.Element
215+
_element.name = AAZStrType()
216+
_element.value = AAZStrType()
217+
218+
image_deprecation_status = cls._schema_on_200.Element.properties.image_deprecation_status
219+
image_deprecation_status.alternative_option = AAZObjectType(
220+
serialized_name="alternativeOption",
221+
)
222+
image_deprecation_status.image_state = AAZStrType(
223+
serialized_name="imageState",
224+
)
225+
image_deprecation_status.scheduled_deprecation_time = AAZStrType(
226+
serialized_name="scheduledDeprecationTime",
227+
)
228+
229+
alternative_option = cls._schema_on_200.Element.properties.image_deprecation_status.alternative_option
230+
alternative_option.type = AAZStrType()
231+
alternative_option.value = AAZStrType()
232+
233+
os_disk_image = cls._schema_on_200.Element.properties.os_disk_image
234+
os_disk_image.operating_system = AAZStrType(
235+
serialized_name="operatingSystem",
236+
flags={"required": True},
237+
)
238+
239+
plan = cls._schema_on_200.Element.properties.plan
240+
plan.name = AAZStrType(
241+
flags={"required": True},
242+
)
243+
plan.product = AAZStrType(
244+
flags={"required": True},
245+
)
246+
plan.publisher = AAZStrType(
247+
flags={"required": True},
248+
)
249+
170250
tags = cls._schema_on_200.Element.tags
171251
tags.Element = AAZStrType()
172252

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/image/_list_publishers.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,92 @@ def _build_schema_on_200(cls):
151151
_element.name = AAZStrType(
152152
flags={"required": True},
153153
)
154+
_element.properties = AAZObjectType()
154155
_element.tags = AAZDictType()
155156

156157
extended_location = cls._schema_on_200.Element.extended_location
157158
extended_location.name = AAZStrType()
158159
extended_location.type = AAZStrType()
159160

161+
properties = cls._schema_on_200.Element.properties
162+
properties.architecture = AAZStrType()
163+
properties.automatic_os_upgrade_properties = AAZObjectType(
164+
serialized_name="automaticOSUpgradeProperties",
165+
)
166+
properties.data_disk_images = AAZListType(
167+
serialized_name="dataDiskImages",
168+
)
169+
properties.disallowed = AAZObjectType()
170+
properties.features = AAZListType()
171+
properties.hyper_v_generation = AAZStrType(
172+
serialized_name="hyperVGeneration",
173+
)
174+
properties.image_deprecation_status = AAZObjectType(
175+
serialized_name="imageDeprecationStatus",
176+
)
177+
properties.os_disk_image = AAZObjectType(
178+
serialized_name="osDiskImage",
179+
)
180+
properties.plan = AAZObjectType()
181+
182+
automatic_os_upgrade_properties = cls._schema_on_200.Element.properties.automatic_os_upgrade_properties
183+
automatic_os_upgrade_properties.automatic_os_upgrade_supported = AAZBoolType(
184+
serialized_name="automaticOSUpgradeSupported",
185+
flags={"required": True},
186+
)
187+
188+
data_disk_images = cls._schema_on_200.Element.properties.data_disk_images
189+
data_disk_images.Element = AAZObjectType()
190+
191+
_element = cls._schema_on_200.Element.properties.data_disk_images.Element
192+
_element.lun = AAZIntType(
193+
flags={"read_only": True},
194+
)
195+
196+
disallowed = cls._schema_on_200.Element.properties.disallowed
197+
disallowed.vm_disk_type = AAZStrType(
198+
serialized_name="vmDiskType",
199+
)
200+
201+
features = cls._schema_on_200.Element.properties.features
202+
features.Element = AAZObjectType()
203+
204+
_element = cls._schema_on_200.Element.properties.features.Element
205+
_element.name = AAZStrType()
206+
_element.value = AAZStrType()
207+
208+
image_deprecation_status = cls._schema_on_200.Element.properties.image_deprecation_status
209+
image_deprecation_status.alternative_option = AAZObjectType(
210+
serialized_name="alternativeOption",
211+
)
212+
image_deprecation_status.image_state = AAZStrType(
213+
serialized_name="imageState",
214+
)
215+
image_deprecation_status.scheduled_deprecation_time = AAZStrType(
216+
serialized_name="scheduledDeprecationTime",
217+
)
218+
219+
alternative_option = cls._schema_on_200.Element.properties.image_deprecation_status.alternative_option
220+
alternative_option.type = AAZStrType()
221+
alternative_option.value = AAZStrType()
222+
223+
os_disk_image = cls._schema_on_200.Element.properties.os_disk_image
224+
os_disk_image.operating_system = AAZStrType(
225+
serialized_name="operatingSystem",
226+
flags={"required": True},
227+
)
228+
229+
plan = cls._schema_on_200.Element.properties.plan
230+
plan.name = AAZStrType(
231+
flags={"required": True},
232+
)
233+
plan.product = AAZStrType(
234+
flags={"required": True},
235+
)
236+
plan.publisher = AAZStrType(
237+
flags={"required": True},
238+
)
239+
160240
tags = cls._schema_on_200.Element.tags
161241
tags.Element = AAZStrType()
162242

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/image/_list_skus.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,92 @@ def _build_schema_on_200(cls):
171171
_element.name = AAZStrType(
172172
flags={"required": True},
173173
)
174+
_element.properties = AAZObjectType()
174175
_element.tags = AAZDictType()
175176

176177
extended_location = cls._schema_on_200.Element.extended_location
177178
extended_location.name = AAZStrType()
178179
extended_location.type = AAZStrType()
179180

181+
properties = cls._schema_on_200.Element.properties
182+
properties.architecture = AAZStrType()
183+
properties.automatic_os_upgrade_properties = AAZObjectType(
184+
serialized_name="automaticOSUpgradeProperties",
185+
)
186+
properties.data_disk_images = AAZListType(
187+
serialized_name="dataDiskImages",
188+
)
189+
properties.disallowed = AAZObjectType()
190+
properties.features = AAZListType()
191+
properties.hyper_v_generation = AAZStrType(
192+
serialized_name="hyperVGeneration",
193+
)
194+
properties.image_deprecation_status = AAZObjectType(
195+
serialized_name="imageDeprecationStatus",
196+
)
197+
properties.os_disk_image = AAZObjectType(
198+
serialized_name="osDiskImage",
199+
)
200+
properties.plan = AAZObjectType()
201+
202+
automatic_os_upgrade_properties = cls._schema_on_200.Element.properties.automatic_os_upgrade_properties
203+
automatic_os_upgrade_properties.automatic_os_upgrade_supported = AAZBoolType(
204+
serialized_name="automaticOSUpgradeSupported",
205+
flags={"required": True},
206+
)
207+
208+
data_disk_images = cls._schema_on_200.Element.properties.data_disk_images
209+
data_disk_images.Element = AAZObjectType()
210+
211+
_element = cls._schema_on_200.Element.properties.data_disk_images.Element
212+
_element.lun = AAZIntType(
213+
flags={"read_only": True},
214+
)
215+
216+
disallowed = cls._schema_on_200.Element.properties.disallowed
217+
disallowed.vm_disk_type = AAZStrType(
218+
serialized_name="vmDiskType",
219+
)
220+
221+
features = cls._schema_on_200.Element.properties.features
222+
features.Element = AAZObjectType()
223+
224+
_element = cls._schema_on_200.Element.properties.features.Element
225+
_element.name = AAZStrType()
226+
_element.value = AAZStrType()
227+
228+
image_deprecation_status = cls._schema_on_200.Element.properties.image_deprecation_status
229+
image_deprecation_status.alternative_option = AAZObjectType(
230+
serialized_name="alternativeOption",
231+
)
232+
image_deprecation_status.image_state = AAZStrType(
233+
serialized_name="imageState",
234+
)
235+
image_deprecation_status.scheduled_deprecation_time = AAZStrType(
236+
serialized_name="scheduledDeprecationTime",
237+
)
238+
239+
alternative_option = cls._schema_on_200.Element.properties.image_deprecation_status.alternative_option
240+
alternative_option.type = AAZStrType()
241+
alternative_option.value = AAZStrType()
242+
243+
os_disk_image = cls._schema_on_200.Element.properties.os_disk_image
244+
os_disk_image.operating_system = AAZStrType(
245+
serialized_name="operatingSystem",
246+
flags={"required": True},
247+
)
248+
249+
plan = cls._schema_on_200.Element.properties.plan
250+
plan.name = AAZStrType(
251+
flags={"required": True},
252+
)
253+
plan.product = AAZStrType(
254+
flags={"required": True},
255+
)
256+
plan.publisher = AAZStrType(
257+
flags={"required": True},
258+
)
259+
180260
tags = cls._schema_on_200.Element.tags
181261
tags.Element = AAZStrType()
182262

0 commit comments

Comments
 (0)