@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)
| 242 | |
| 243 | |
| 244 | def 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 | |
| 269 | def get_physical_networks(apiclient, zoneid): |
| 270 | ''' |