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

Method create

tools/marvin/marvin/lib/base.py:43–74  ·  view source on GitHub ↗

Creates an domain

(cls, apiclient, services, name=None, networkdomain=None,
               parentdomainid=None, domainid=None)

Source from the content-addressed store, hash-verified

41
42 @classmethod
43 def create(cls, apiclient, services, name=None, networkdomain=None,
44 parentdomainid=None, domainid=None):
45 """Creates an domain"""
46
47 cmd = createDomain.createDomainCmd()
48
49 if "domainUUID" in services:
50 cmd.domainid = "-".join([services["domainUUID"], random_gen()])
51
52 if name:
53 cmd.name = "-".join([name, random_gen()])
54 elif "name" in services:
55 cmd.name = "-".join([services["name"], random_gen()])
56
57 if networkdomain:
58 cmd.networkdomain = networkdomain
59 elif "networkdomain" in services:
60 cmd.networkdomain = services["networkdomain"]
61
62 if parentdomainid:
63 cmd.parentdomainid = parentdomainid
64 elif "parentdomainid" in services:
65 cmd.parentdomainid = services["parentdomainid"]
66
67 if domainid:
68 cmd.domainid = domainid
69 try:
70 domain = apiclient.createDomain(cmd)
71 if domain is not None:
72 return Domain(domain.__dict__)
73 except Exception as e:
74 raise e
75
76 def delete(self, apiclient, cleanup=None):
77 """Delete an domain"""

Callers

nothing calls this directly

Implementers 1

DomainVOengine/schema/src/main/java/com/cloud/

Calls 4

random_genFunction · 0.90
DomainClass · 0.70
createDomainMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected