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

Function get_region

tools/marvin/marvin/lib/common.py:186–201  ·  view source on GitHub ↗

@name : get_region @Desc : Returns the Region Information for a given region id or region name @Input : region_name: Name of the Region region_id : Id of the region @Output : 1. Region Information for the passed inputs else first Region 2. FAILED In case

(apiclient, region_id=None, region_name=None)

Source from the content-addressed store, hash-verified

184
185
186def get_region(apiclient, region_id=None, region_name=None):
187 '''
188 @name : get_region
189 @Desc : Returns the Region Information for a given region id or region name
190 @Input : region_name: Name of the Region
191 region_id : Id of the region
192 @Output : 1. Region Information for the passed inputs else first Region
193 2. FAILED In case the cmd failed
194 '''
195 cmd = listRegions.listRegionsCmd()
196 if region_name is not None:
197 cmd.name = region_name
198 if region_id is not None:
199 cmd.id = region_id
200 cmd_out = apiclient.listRegions(cmd)
201 return FAILED if validateList(cmd_out)[0] != PASS else cmd_out[0]
202
203
204def get_domain(apiclient, domain_id=None, domain_name=None):

Callers 7

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
listRegionsMethod · 0.65

Tested by 7

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