MCPcopy Create free account
hub / github.com/apache/cloudstack / get_zone

Function get_zone

tools/marvin/marvin/lib/common.py:244–267  ·  view source on GitHub ↗

@name : get_zone @Desc :Returns the Zone Information for a given zone id or Zone Name @Input : zone_name: Name of the Zone zone_id : Id of the zone @Output : 1. Zone Information for the passed inputs else first zone 2. FAILED In case the cmd failed

(apiclient, zone_name=None, zone_id=None)

Source from the content-addressed store, hash-verified

242
243
244def get_zone(apiclient, zone_name=None, zone_id=None):
245 '''
246 @name : get_zone
247 @Desc :Returns the Zone Information for a given zone id or Zone Name
248 @Input : zone_name: Name of the Zone
249 zone_id : Id of the zone
250 @Output : 1. Zone Information for the passed inputs else first zone
251 2. FAILED In case the cmd failed
252 '''
253 cmd = listZones.listZonesCmd()
254 if zone_name is not None:
255 cmd.name = zone_name
256 if zone_id is not None:
257 cmd.id = zone_id
258
259 cmd_out = apiclient.listZones(cmd)
260
261 if validateList(cmd_out)[0] != PASS:
262 return FAILED
263 '''
264 Check if input zone name and zone id is None,
265 then return first element of List Zones command
266 '''
267 return cmd_out[0]
268
269def get_physical_networks(apiclient, zoneid):
270 '''

Callers 15

setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90
setUpClassMethod · 0.90

Calls 2

validateListFunction · 0.90
listZonesMethod · 0.65

Tested by 15

setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72
setUpClassMethod · 0.72