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

Function get_domain

tools/marvin/marvin/lib/common.py:204–222  ·  view source on GitHub ↗

@name : get_domain @Desc : Returns the Domain Information for a given domain id or domain name @Input : domain id : Id of the Domain domain_name : Name of the Domain @Output : 1. Domain Information for the passed inputs else first Domain 2. FAILED In case

(apiclient, domain_id=None, domain_name=None)

Source from the content-addressed store, hash-verified

202
203
204def get_domain(apiclient, domain_id=None, domain_name=None):
205 '''
206 @name : get_domain
207 @Desc : Returns the Domain Information for a given domain id or domain name
208 @Input : domain id : Id of the Domain
209 domain_name : Name of the Domain
210 @Output : 1. Domain Information for the passed inputs else first Domain
211 2. FAILED In case the cmd failed
212 '''
213 cmd = listDomains.listDomainsCmd()
214
215 if domain_name is not None:
216 cmd.name = domain_name
217 if domain_id is not None:
218 cmd.id = domain_id
219 cmd_out = apiclient.listDomains(cmd)
220 if validateList(cmd_out)[0] != PASS:
221 return FAILED
222 return cmd_out[0]
223
224
225def find_storage_pool_type(apiclient, storagetype='NetworkFileSystem'):

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 1

validateListFunction · 0.90

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