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

Method create

tools/marvin/marvin/lib/base.py:1152–1187  ·  view source on GitHub ↗

Create Volume

(cls, apiclient, services, zoneid=None, account=None,
               domainid=None, diskofferingid=None, projectid=None, size=None, snapshotid=None)

Source from the content-addressed store, hash-verified

1150
1151 @classmethod
1152 def create(cls, apiclient, services, zoneid=None, account=None,
1153 domainid=None, diskofferingid=None, projectid=None, size=None, snapshotid=None):
1154 """Create Volume"""
1155 cmd = createVolume.createVolumeCmd()
1156 cmd.name = "-".join([services["diskname"], random_gen()])
1157
1158 if diskofferingid:
1159 cmd.diskofferingid = diskofferingid
1160 elif "diskofferingid" in services:
1161 cmd.diskofferingid = services["diskofferingid"]
1162
1163 if zoneid:
1164 cmd.zoneid = zoneid
1165 elif "zoneid" in services:
1166 cmd.zoneid = services["zoneid"]
1167
1168 if account:
1169 cmd.account = account
1170 elif "account" in services:
1171 cmd.account = services["account"]
1172
1173 if domainid:
1174 cmd.domainid = domainid
1175 elif "domainid" in services:
1176 cmd.domainid = services["domainid"]
1177
1178 if projectid:
1179 cmd.projectid = projectid
1180
1181 if size:
1182 cmd.size = size
1183
1184 if snapshotid:
1185 cmd.snapshotid = snapshotid
1186
1187 return Volume(apiclient.createVolume(cmd).__dict__)
1188
1189 def update(self, apiclient, **kwargs):
1190 """Updates the volume"""

Callers

nothing calls this directly

Implementers 1

VolumeVOengine/schema/src/main/java/com/cloud/

Calls 4

random_genFunction · 0.90
VolumeClass · 0.70
createVolumeMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected