mirror of https://github.com/apache/cloudstack.git
marvin_refactor: remove all the code that is auto-generated
All factories and base modules are auto-generated by the entity_generator
This commit is contained in:
parent
2f3e0ef828
commit
9888bb2561
|
|
@ -1,104 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import enableAccount
|
||||
from marvin.cloudstackAPI import lockAccount
|
||||
from marvin.cloudstackAPI import createAccount
|
||||
from marvin.cloudstackAPI import listAccounts
|
||||
from marvin.cloudstackAPI import updateAccount
|
||||
from marvin.cloudstackAPI import disableAccount
|
||||
from marvin.cloudstackAPI import deleteAccount
|
||||
from marvin.cloudstackAPI import markDefaultZoneForAccount
|
||||
|
||||
|
||||
class Account(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def enable(self, apiclient, **kwargs):
|
||||
cmd = enableAccount.enableAccountCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.enableAccount(cmd)
|
||||
return account
|
||||
|
||||
|
||||
def lock(self, apiclient, account, domainid, **kwargs):
|
||||
cmd = lockAccount.lockAccountCmd()
|
||||
cmd.id = self.id
|
||||
cmd.account = account
|
||||
cmd.domainid = domainid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.lockAccount(cmd)
|
||||
return account
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createAccount.createAccountCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.createAccount(cmd)
|
||||
return Account(account.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listAccounts.listAccountsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.listAccounts(cmd)
|
||||
return map(lambda e: Account(e.__dict__), account)
|
||||
|
||||
|
||||
def update(self, apiclient, newname, **kwargs):
|
||||
cmd = updateAccount.updateAccountCmd()
|
||||
cmd.id = self.id
|
||||
cmd.newname = newname
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.updateAccount(cmd)
|
||||
return account
|
||||
|
||||
|
||||
def disable(self, apiclient, lock, **kwargs):
|
||||
cmd = disableAccount.disableAccountCmd()
|
||||
cmd.id = self.id
|
||||
cmd.lock = lock
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.disableAccount(cmd)
|
||||
return account
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteAccount.deleteAccountCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
account = apiclient.deleteAccount(cmd)
|
||||
return account
|
||||
|
||||
|
||||
def mark(self, apiclient, zoneid, **kwargs):
|
||||
cmd = markDefaultZoneForAccount.markDefaultZoneForAccountCmd()
|
||||
cmd.id = self.id
|
||||
cmd.account = self.account
|
||||
cmd.domainid = self.domainid
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
defaultzoneforaccount = apiclient.markDefaultZoneForAccount(cmd)
|
||||
return defaultzoneforaccount
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listAlerts
|
||||
from marvin.cloudstackAPI import deleteAlerts
|
||||
|
||||
class Alerts(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listAlerts.listAlertsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
alerts = apiclient.listAlerts(cmd)
|
||||
return map(lambda e: Alerts(e.__dict__), alerts)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteAlerts.deleteAlertsCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
alerts = apiclient.deleteAlerts(cmd)
|
||||
return alerts
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import resetApiLimit
|
||||
from marvin.cloudstackAPI import getApiLimit
|
||||
|
||||
class ApiLimit(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def reset(self, apiclient, **kwargs):
|
||||
cmd = resetApiLimit.resetApiLimitCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
apilimit = apiclient.resetApiLimit(cmd)
|
||||
return apilimit
|
||||
|
||||
|
||||
def get(self, apiclient, **kwargs):
|
||||
cmd = getApiLimit.getApiLimitCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
apilimit = apiclient.getApiLimit(cmd)
|
||||
return apilimit
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listApis
|
||||
|
||||
class Apis(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listApis.listApisCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
apis = apiclient.listApis(cmd)
|
||||
return map(lambda e: Apis(e.__dict__), apis)
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import queryAsyncJobResult
|
||||
|
||||
class AsyncJobResult(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def query(self, apiclient, jobid, **kwargs):
|
||||
cmd = queryAsyncJobResult.queryAsyncJobResultCmd()
|
||||
cmd.id = self.id
|
||||
cmd.jobid = jobid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
asyncjobresult = apiclient.queryAsyncJobResult(cmd)
|
||||
return asyncjobresult
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listAsyncJobs
|
||||
|
||||
class AsyncJobs(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listAsyncJobs.listAsyncJobsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
asyncjobs = apiclient.listAsyncJobs(cmd)
|
||||
return map(lambda e: AsyncJobs(e.__dict__), asyncjobs)
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createAutoScalePolicy
|
||||
from marvin.cloudstackAPI import updateAutoScalePolicy
|
||||
from marvin.cloudstackAPI import deleteAutoScalePolicy
|
||||
from marvin.cloudstackAPI import listAutoScalePolicies
|
||||
|
||||
class AutoScalePolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createAutoScalePolicy.createAutoScalePolicyCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalepolicy = apiclient.createAutoScalePolicy(cmd)
|
||||
return AutoScalePolicy(autoscalepolicy.__dict__)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateAutoScalePolicy.updateAutoScalePolicyCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalepolicy = apiclient.updateAutoScalePolicy(cmd)
|
||||
return autoscalepolicy
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteAutoScalePolicy.deleteAutoScalePolicyCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalepolicy = apiclient.deleteAutoScalePolicy(cmd)
|
||||
return autoscalepolicy
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listAutoScalePolicies.listAutoScalePoliciesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalepolicies = apiclient.listAutoScalePolicies(cmd)
|
||||
return map(lambda e: AutoScalePolicy(e.__dict__), autoscalepolicies)
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import enableAutoScaleVmGroup
|
||||
from marvin.cloudstackAPI import createAutoScaleVmGroup
|
||||
from marvin.cloudstackAPI import listAutoScaleVmGroups
|
||||
from marvin.cloudstackAPI import updateAutoScaleVmGroup
|
||||
from marvin.cloudstackAPI import disableAutoScaleVmGroup
|
||||
from marvin.cloudstackAPI import deleteAutoScaleVmGroup
|
||||
|
||||
class AutoScaleVmGroup(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def enable(self, apiclient, **kwargs):
|
||||
cmd = enableAutoScaleVmGroup.enableAutoScaleVmGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmgroup = apiclient.enableAutoScaleVmGroup(cmd)
|
||||
return autoscalevmgroup
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createAutoScaleVmGroup.createAutoScaleVmGroupCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmgroup = apiclient.createAutoScaleVmGroup(cmd)
|
||||
return AutoScaleVmGroup(autoscalevmgroup.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listAutoScaleVmGroups.listAutoScaleVmGroupsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmgroup = apiclient.listAutoScaleVmGroups(cmd)
|
||||
return map(lambda e: AutoScaleVmGroup(e.__dict__), autoscalevmgroup)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateAutoScaleVmGroup.updateAutoScaleVmGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmgroup = apiclient.updateAutoScaleVmGroup(cmd)
|
||||
return autoscalevmgroup
|
||||
|
||||
|
||||
def disable(self, apiclient, **kwargs):
|
||||
cmd = disableAutoScaleVmGroup.disableAutoScaleVmGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmgroup = apiclient.disableAutoScaleVmGroup(cmd)
|
||||
return autoscalevmgroup
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteAutoScaleVmGroup.deleteAutoScaleVmGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmgroup = apiclient.deleteAutoScaleVmGroup(cmd)
|
||||
return autoscalevmgroup
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createAutoScaleVmProfile
|
||||
from marvin.cloudstackAPI import listAutoScaleVmProfiles
|
||||
from marvin.cloudstackAPI import updateAutoScaleVmProfile
|
||||
from marvin.cloudstackAPI import deleteAutoScaleVmProfile
|
||||
|
||||
class AutoScaleVmProfile(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createAutoScaleVmProfile.createAutoScaleVmProfileCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmprofile = apiclient.createAutoScaleVmProfile(cmd)
|
||||
return AutoScaleVmProfile(autoscalevmprofile.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listAutoScaleVmProfiles.listAutoScaleVmProfilesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmprofile = apiclient.listAutoScaleVmProfiles(cmd)
|
||||
return map(lambda e: AutoScaleVmProfile(e.__dict__), autoscalevmprofile)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateAutoScaleVmProfile.updateAutoScaleVmProfileCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmprofile = apiclient.updateAutoScaleVmProfile(cmd)
|
||||
return autoscalevmprofile
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteAutoScaleVmProfile.deleteAutoScaleVmProfileCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
autoscalevmprofile = apiclient.deleteAutoScaleVmProfile(cmd)
|
||||
return autoscalevmprofile
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addBigSwitchVnsDevice
|
||||
from marvin.cloudstackAPI import listBigSwitchVnsDevices
|
||||
from marvin.cloudstackAPI import deleteBigSwitchVnsDevice
|
||||
|
||||
class BigSwitchVnsDevice(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, physicalnetworkid, hostname, **kwargs):
|
||||
cmd = addBigSwitchVnsDevice.addBigSwitchVnsDeviceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.hostname = hostname
|
||||
cmd.physicalnetworkid = physicalnetworkid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
bigswitchvnsdevice = apiclient.addBigSwitchVnsDevice(cmd)
|
||||
return bigswitchvnsdevice
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listBigSwitchVnsDevices.listBigSwitchVnsDevicesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
bigswitchvnsdevice = apiclient.listBigSwitchVnsDevices(cmd)
|
||||
return map(lambda e: BigSwitchVnsDevice(e.__dict__), bigswitchvnsdevice)
|
||||
|
||||
|
||||
def delete(self, apiclient, vnsdeviceid, **kwargs):
|
||||
cmd = deleteBigSwitchVnsDevice.deleteBigSwitchVnsDeviceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.vnsdeviceid = vnsdeviceid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
bigswitchvnsdevice = apiclient.deleteBigSwitchVnsDevice(cmd)
|
||||
return bigswitchvnsdevice
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listCapabilities
|
||||
|
||||
class Capabilities(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listCapabilities.listCapabilitiesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
capabilities = apiclient.listCapabilities(cmd)
|
||||
return map(lambda e: Capabilities(e.__dict__), capabilities)
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listCapacity
|
||||
|
||||
class Capacity(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listCapacity.listCapacityCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
capacity = apiclient.listCapacity(cmd)
|
||||
return map(lambda e: Capacity(e.__dict__), capacity)
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import getCloudIdentifier
|
||||
|
||||
class CloudIdentifier(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def get(self, apiclient, userid, **kwargs):
|
||||
cmd = getCloudIdentifier.getCloudIdentifierCmd()
|
||||
cmd.id = self.id
|
||||
cmd.userid = userid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
cloudidentifier = apiclient.getCloudIdentifier(cmd)
|
||||
return cloudidentifier
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addCluster
|
||||
from marvin.cloudstackAPI import listClusters
|
||||
from marvin.cloudstackAPI import updateCluster
|
||||
from marvin.cloudstackAPI import deleteCluster
|
||||
|
||||
class Cluster(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, clustername, hypervisor, zoneid, clustertype, podid, **kwargs):
|
||||
cmd = addCluster.addClusterCmd()
|
||||
cmd.id = self.id
|
||||
cmd.clustername = clustername
|
||||
cmd.clustertype = clustertype
|
||||
cmd.hypervisor = hypervisor
|
||||
cmd.podid = podid
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
cluster = apiclient.addCluster(cmd)
|
||||
return cluster
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listClusters.listClustersCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
cluster = apiclient.listClusters(cmd)
|
||||
return map(lambda e: Cluster(e.__dict__), cluster)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateCluster.updateClusterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
cluster = apiclient.updateCluster(cmd)
|
||||
return cluster
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteCluster.deleteClusterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
cluster = apiclient.deleteCluster(cmd)
|
||||
return cluster
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createCondition
|
||||
from marvin.cloudstackAPI import listConditions
|
||||
from marvin.cloudstackAPI import deleteCondition
|
||||
|
||||
class Condition(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createCondition.createConditionCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
condition = apiclient.createCondition(cmd)
|
||||
return Condition(condition.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listConditions.listConditionsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
condition = apiclient.listConditions(cmd)
|
||||
return map(lambda e: Condition(e.__dict__), condition)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteCondition.deleteConditionCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
condition = apiclient.deleteCondition(cmd)
|
||||
return condition
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listConfigurations
|
||||
from marvin.cloudstackAPI import updateConfiguration
|
||||
|
||||
class Configuration(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listConfigurations.listConfigurationsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
configuration = apiclient.listConfigurations(cmd)
|
||||
return map(lambda e: Configuration(e.__dict__), configuration)
|
||||
|
||||
|
||||
def update(self, apiclient, name, **kwargs):
|
||||
cmd = updateConfiguration.updateConfigurationCmd()
|
||||
cmd.id = self.id
|
||||
cmd.name = name
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
configuration = apiclient.updateConfiguration(cmd)
|
||||
return configuration
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createCounter
|
||||
from marvin.cloudstackAPI import listCounters
|
||||
from marvin.cloudstackAPI import deleteCounter
|
||||
|
||||
class Counter(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createCounter.createCounterCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
counter = apiclient.createCounter(cmd)
|
||||
return Counter(counter.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listCounters.listCountersCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
counter = apiclient.listCounters(cmd)
|
||||
return map(lambda e: Counter(e.__dict__), counter)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteCounter.deleteCounterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
counter = apiclient.deleteCounter(cmd)
|
||||
return counter
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import uploadCustomCertificate
|
||||
|
||||
class CustomCertificate(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def upload(self, apiclient, domainsuffix, certificate, **kwargs):
|
||||
cmd = uploadCustomCertificate.uploadCustomCertificateCmd()
|
||||
cmd.id = self.id
|
||||
cmd.certificate = certificate
|
||||
cmd.domainsuffix = domainsuffix
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
customcertificate = apiclient.uploadCustomCertificate(cmd)
|
||||
return customcertificate
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createDiskOffering
|
||||
from marvin.cloudstackAPI import listDiskOfferings
|
||||
from marvin.cloudstackAPI import updateDiskOffering
|
||||
from marvin.cloudstackAPI import deleteDiskOffering
|
||||
|
||||
class DiskOffering(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createDiskOffering.createDiskOfferingCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
diskoffering = apiclient.createDiskOffering(cmd)
|
||||
return DiskOffering(diskoffering.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listDiskOfferings.listDiskOfferingsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
diskoffering = apiclient.listDiskOfferings(cmd)
|
||||
return map(lambda e: DiskOffering(e.__dict__), diskoffering)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateDiskOffering.updateDiskOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
diskoffering = apiclient.updateDiskOffering(cmd)
|
||||
return diskoffering
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteDiskOffering.deleteDiskOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
diskoffering = apiclient.deleteDiskOffering(cmd)
|
||||
return diskoffering
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createDomain
|
||||
from marvin.cloudstackAPI import listDomains
|
||||
from marvin.cloudstackAPI import updateDomain
|
||||
from marvin.cloudstackAPI import deleteDomain
|
||||
|
||||
class Domain(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createDomain.createDomainCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
domain = apiclient.createDomain(cmd)
|
||||
return Domain(domain.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listDomains.listDomainsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
domain = apiclient.listDomains(cmd)
|
||||
return map(lambda e: Domain(e.__dict__), domain)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateDomain.updateDomainCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
domain = apiclient.updateDomain(cmd)
|
||||
return domain
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteDomain.deleteDomainCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
domain = apiclient.deleteDomain(cmd)
|
||||
return domain
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listDomainChildren
|
||||
|
||||
class DomainChildren(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listDomainChildren.listDomainChildrenCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
domainchildren = apiclient.listDomainChildren(cmd)
|
||||
return map(lambda e: DomainChildren(e.__dict__), domainchildren)
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createEgressFirewallRule
|
||||
from marvin.cloudstackAPI import listEgressFirewallRules
|
||||
from marvin.cloudstackAPI import deleteEgressFirewallRule
|
||||
|
||||
class EgressFirewallRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createEgressFirewallRule.createEgressFirewallRuleCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
egressfirewallrule = apiclient.createEgressFirewallRule(cmd)
|
||||
return EgressFirewallRule(egressfirewallrule.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listEgressFirewallRules.listEgressFirewallRulesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
egressfirewallrule = apiclient.listEgressFirewallRules(cmd)
|
||||
return map(lambda e: EgressFirewallRule(e.__dict__), egressfirewallrule)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteEgressFirewallRule.deleteEgressFirewallRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
egressfirewallrule = apiclient.deleteEgressFirewallRule(cmd)
|
||||
return egressfirewallrule
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listEventTypes
|
||||
|
||||
class EventTypes(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listEventTypes.listEventTypesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
eventtypes = apiclient.listEventTypes(cmd)
|
||||
return map(lambda e: EventTypes(e.__dict__), eventtypes)
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listEvents
|
||||
from marvin.cloudstackAPI import deleteEvents
|
||||
|
||||
class Events(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listEvents.listEventsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
events = apiclient.listEvents(cmd)
|
||||
return map(lambda e: Events(e.__dict__), events)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteEvents.deleteEventsCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
events = apiclient.deleteEvents(cmd)
|
||||
return events
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createFirewallRule
|
||||
from marvin.cloudstackAPI import listFirewallRules
|
||||
from marvin.cloudstackAPI import deleteFirewallRule
|
||||
|
||||
class FirewallRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createFirewallRule.createFirewallRuleCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
firewallrule = apiclient.createFirewallRule(cmd)
|
||||
return FirewallRule(firewallrule.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listFirewallRules.listFirewallRulesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
firewallrule = apiclient.listFirewallRules(cmd)
|
||||
return map(lambda e: FirewallRule(e.__dict__), firewallrule)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteFirewallRule.deleteFirewallRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
firewallrule = apiclient.deleteFirewallRule(cmd)
|
||||
return firewallrule
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createGlobalLoadBalancerRule
|
||||
from marvin.cloudstackAPI import listGlobalLoadBalancerRules
|
||||
from marvin.cloudstackAPI import updateGlobalLoadBalancerRule
|
||||
from marvin.cloudstackAPI import deleteGlobalLoadBalancerRule
|
||||
from marvin.cloudstackAPI import removeFromGlobalLoadBalancerRule
|
||||
from marvin.cloudstackAPI import assignToGlobalLoadBalancerRule
|
||||
|
||||
class GlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createGlobalLoadBalancerRule.createGlobalLoadBalancerRuleCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
globalloadbalancerrule = apiclient.createGlobalLoadBalancerRule(cmd)
|
||||
return GlobalLoadBalancerRule(globalloadbalancerrule.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listGlobalLoadBalancerRules.listGlobalLoadBalancerRulesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
globalloadbalancerrule = apiclient.listGlobalLoadBalancerRules(cmd)
|
||||
return map(lambda e: GlobalLoadBalancerRule(e.__dict__), globalloadbalancerrule)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateGlobalLoadBalancerRule.updateGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
globalloadbalancerrule = apiclient.updateGlobalLoadBalancerRule(cmd)
|
||||
return globalloadbalancerrule
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteGlobalLoadBalancerRule.deleteGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
globalloadbalancerrule = apiclient.deleteGlobalLoadBalancerRule(cmd)
|
||||
return globalloadbalancerrule
|
||||
|
||||
|
||||
def remove(self, apiclient, loadbalancerrulelist, **kwargs):
|
||||
cmd = removeFromGlobalLoadBalancerRule.removeFromGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.loadbalancerrulelist = loadbalancerrulelist
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
fromgloballoadbalancerrule = apiclient.removeFromGlobalLoadBalancerRule(cmd)
|
||||
return fromgloballoadbalancerrule
|
||||
|
||||
|
||||
def assign(self, apiclient, loadbalancerrulelist, **kwargs):
|
||||
cmd = assignToGlobalLoadBalancerRule.assignToGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.loadbalancerrulelist = loadbalancerrulelist
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
togloballoadbalancerrule = apiclient.assignToGlobalLoadBalancerRule(cmd)
|
||||
return togloballoadbalancerrule
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addHost
|
||||
from marvin.cloudstackAPI import listHosts
|
||||
from marvin.cloudstackAPI import updateHost
|
||||
from marvin.cloudstackAPI import reconnectHost
|
||||
from marvin.cloudstackAPI import deleteHost
|
||||
from marvin.cloudstackAPI import prepareHostForMaintenance
|
||||
from marvin.cloudstackAPI import cancelHostMaintenance
|
||||
from marvin.cloudstackAPI import updateHostPassword
|
||||
|
||||
class Host(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, username, podid, url, hypervisor, zoneid, password, **kwargs):
|
||||
cmd = addHost.addHostCmd()
|
||||
cmd.id = self.id
|
||||
cmd.hypervisor = hypervisor
|
||||
cmd.password = password
|
||||
cmd.podid = podid
|
||||
cmd.url = url
|
||||
cmd.username = username
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
host = apiclient.addHost(cmd)
|
||||
return host
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listHosts.listHostsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
host = apiclient.listHosts(cmd)
|
||||
return map(lambda e: Host(e.__dict__), host)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateHost.updateHostCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
host = apiclient.updateHost(cmd)
|
||||
return host
|
||||
|
||||
|
||||
def reconnect(self, apiclient, **kwargs):
|
||||
cmd = reconnectHost.reconnectHostCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
host = apiclient.reconnectHost(cmd)
|
||||
return host
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteHost.deleteHostCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
host = apiclient.deleteHost(cmd)
|
||||
return host
|
||||
|
||||
|
||||
def prepareMaintenance(self, apiclient, **kwargs):
|
||||
cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hostformaintenance = apiclient.prepareHostForMaintenance(cmd)
|
||||
return hostformaintenance
|
||||
|
||||
|
||||
def cancelMaintenance(self, apiclient, **kwargs):
|
||||
cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hostmaintenance = apiclient.cancelHostMaintenance(cmd)
|
||||
return hostmaintenance
|
||||
|
||||
|
||||
def updatePassword(self, apiclient, username, password, **kwargs):
|
||||
cmd = updateHostPassword.updateHostPasswordCmd()
|
||||
cmd.id = self.id
|
||||
cmd.password = password
|
||||
cmd.username = username
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hostpassword = apiclient.updateHostPassword(cmd)
|
||||
return hostpassword
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listHypervisorCapabilities
|
||||
from marvin.cloudstackAPI import updateHypervisorCapabilities
|
||||
|
||||
class HypervisorCapabilities(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hypervisorcapabilities = apiclient.listHypervisorCapabilities(cmd)
|
||||
return map(lambda e: HypervisorCapabilities(e.__dict__), hypervisorcapabilities)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateHypervisorCapabilities.updateHypervisorCapabilitiesCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hypervisorcapabilities = apiclient.updateHypervisorCapabilities(cmd)
|
||||
return hypervisorcapabilities
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listHypervisors
|
||||
|
||||
class Hypervisors(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listHypervisors.listHypervisorsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hypervisors = apiclient.listHypervisors(cmd)
|
||||
return map(lambda e: Hypervisors(e.__dict__), hypervisors)
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createInstanceGroup
|
||||
from marvin.cloudstackAPI import listInstanceGroups
|
||||
from marvin.cloudstackAPI import updateInstanceGroup
|
||||
from marvin.cloudstackAPI import deleteInstanceGroup
|
||||
|
||||
class InstanceGroup(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createInstanceGroup.createInstanceGroupCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
instancegroup = apiclient.createInstanceGroup(cmd)
|
||||
return InstanceGroup(instancegroup.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listInstanceGroups.listInstanceGroupsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
instancegroup = apiclient.listInstanceGroups(cmd)
|
||||
return map(lambda e: InstanceGroup(e.__dict__), instancegroup)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateInstanceGroup.updateInstanceGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
instancegroup = apiclient.updateInstanceGroup(cmd)
|
||||
return instancegroup
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteInstanceGroup.deleteInstanceGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
instancegroup = apiclient.deleteInstanceGroup(cmd)
|
||||
return instancegroup
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import disassociateIpAddress
|
||||
from marvin.cloudstackAPI import associateIpAddress
|
||||
from marvin.cloudstackAPI import listPublicIpAddresses
|
||||
|
||||
class IpAddress(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def disassociate(self, apiclient, **kwargs):
|
||||
cmd = disassociateIpAddress.disassociateIpAddressCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipaddress = apiclient.disassociateIpAddress(cmd)
|
||||
return ipaddress
|
||||
|
||||
|
||||
def associate(self, apiclient, **kwargs):
|
||||
cmd = associateIpAddress.associateIpAddressCmd()
|
||||
# cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipaddress = apiclient.associateIpAddress(cmd)
|
||||
return ipaddress
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listPublicIpAddresses.listPublicIpAddressesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
publicipaddresses = apiclient.listPublicIpAddresses(cmd)
|
||||
return map(lambda e: IpAddress(e.__dict__), publicipaddresses)
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createIpForwardingRule
|
||||
from marvin.cloudstackAPI import listIpForwardingRules
|
||||
from marvin.cloudstackAPI import deleteIpForwardingRule
|
||||
|
||||
class IpForwardingRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createIpForwardingRule.createIpForwardingRuleCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipforwardingrule = apiclient.createIpForwardingRule(cmd)
|
||||
return IpForwardingRule(ipforwardingrule.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listIpForwardingRules.listIpForwardingRulesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipforwardingrule = apiclient.listIpForwardingRules(cmd)
|
||||
return map(lambda e: IpForwardingRule(e.__dict__), ipforwardingrule)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipforwardingrule = apiclient.deleteIpForwardingRule(cmd)
|
||||
return ipforwardingrule
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import copyIso
|
||||
from marvin.cloudstackAPI import registerIso
|
||||
from marvin.cloudstackAPI import listIsos
|
||||
from marvin.cloudstackAPI import updateIso
|
||||
from marvin.cloudstackAPI import attachIso
|
||||
from marvin.cloudstackAPI import detachIso
|
||||
from marvin.cloudstackAPI import extractIso
|
||||
from marvin.cloudstackAPI import deleteIso
|
||||
|
||||
class Iso(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def copy(self, apiclient, sourcezoneid, destzoneid, **kwargs):
|
||||
cmd = copyIso.copyIsoCmd()
|
||||
cmd.id = self.id
|
||||
cmd.destzoneid = destzoneid
|
||||
cmd.sourcezoneid = sourcezoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.copyIso(cmd)
|
||||
return iso
|
||||
|
||||
|
||||
def register(self, apiclient, url, displaytext, name, zoneid, **kwargs):
|
||||
cmd = registerIso.registerIsoCmd()
|
||||
cmd.id = self.id
|
||||
cmd.displaytext = displaytext
|
||||
cmd.name = name
|
||||
cmd.url = url
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.registerIso(cmd)
|
||||
return iso
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listIsos.listIsosCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.listIsos(cmd)
|
||||
return map(lambda e: Iso(e.__dict__), iso)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateIso.updateIsoCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.updateIso(cmd)
|
||||
return iso
|
||||
|
||||
|
||||
def attach(self, apiclient, virtualmachineid, **kwargs):
|
||||
cmd = attachIso.attachIsoCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.attachIso(cmd)
|
||||
return iso
|
||||
|
||||
|
||||
def detach(self, apiclient, virtualmachineid, **kwargs):
|
||||
cmd = detachIso.detachIsoCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.detachIso(cmd)
|
||||
return iso
|
||||
|
||||
|
||||
def extract(self, apiclient, mode, **kwargs):
|
||||
cmd = extractIso.extractIsoCmd()
|
||||
cmd.id = self.id
|
||||
cmd.mode = mode
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.extractIso(cmd)
|
||||
return iso
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteIso.deleteIsoCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iso = apiclient.deleteIso(cmd)
|
||||
return iso
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listIsoPermissions
|
||||
from marvin.cloudstackAPI import updateIsoPermissions
|
||||
|
||||
class IsoPermissions(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listIsoPermissions.listIsoPermissionsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
isopermissions = apiclient.listIsoPermissions(cmd)
|
||||
return map(lambda e: IsoPermissions(e.__dict__), isopermissions)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateIsoPermissions.updateIsoPermissionsCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
isopermissions = apiclient.updateIsoPermissions(cmd)
|
||||
return isopermissions
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createLBHealthCheckPolicy
|
||||
from marvin.cloudstackAPI import deleteLBHealthCheckPolicy
|
||||
from marvin.cloudstackAPI import listLBHealthCheckPolicies
|
||||
|
||||
class LBHealthCheckPolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createLBHealthCheckPolicy.createLBHealthCheckPolicyCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
lbhealthcheckpolicy = apiclient.createLBHealthCheckPolicy(cmd)
|
||||
return LBHealthCheckPolicy(lbhealthcheckpolicy.__dict__)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteLBHealthCheckPolicy.deleteLBHealthCheckPolicyCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
lbhealthcheckpolicy = apiclient.deleteLBHealthCheckPolicy(cmd)
|
||||
return lbhealthcheckpolicy
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, lbruleid, **kwargs):
|
||||
cmd = listLBHealthCheckPolicies.listLBHealthCheckPoliciesCmd()
|
||||
cmd.lbruleid = lbruleid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
lbhealthcheckpolicies = apiclient.listLBHealthCheckPolicies(cmd)
|
||||
return map(lambda e: LBHealthCheckPolicy(e.__dict__), lbhealthcheckpolicies)
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createLBStickinessPolicy
|
||||
from marvin.cloudstackAPI import deleteLBStickinessPolicy
|
||||
from marvin.cloudstackAPI import listLBStickinessPolicies
|
||||
|
||||
class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
lbstickinesspolicy = apiclient.createLBStickinessPolicy(cmd)
|
||||
return LBStickinessPolicy(lbstickinesspolicy.__dict__)
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd()
|
||||
cmd.id = self.id
|
||||
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
lbstickinesspolicy = apiclient.deleteLBStickinessPolicy(cmd)
|
||||
return lbstickinesspolicy
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, lbruleid, **kwargs):
|
||||
cmd = listLBStickinessPolicies.listLBStickinessPoliciesCmd()
|
||||
cmd.lbruleid = lbruleid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
lbstickinesspolicies = apiclient.listLBStickinessPolicies(cmd)
|
||||
return map(lambda e: LBStickinessPolicy(e.__dict__), lbstickinesspolicies)
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import ldapRemove
|
||||
from marvin.cloudstackAPI import ldapConfig
|
||||
|
||||
class Ldap(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def config(self, apiclient, **kwargs):
|
||||
cmd = ldapConfig.ldapConfigCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
config = apiclient.ldapConfig(cmd)
|
||||
return config
|
||||
|
||||
|
||||
def remove(self, apiclient, **kwargs):
|
||||
cmd = ldapRemove.ldapRemoveCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
remove = apiclient.ldapRemove(cmd)
|
||||
return remove
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createLoadBalancerRule
|
||||
from marvin.cloudstackAPI import listLoadBalancerRules
|
||||
from marvin.cloudstackAPI import updateLoadBalancerRule
|
||||
from marvin.cloudstackAPI import deleteLoadBalancerRule
|
||||
from marvin.cloudstackAPI import removeFromLoadBalancerRule
|
||||
from marvin.cloudstackAPI import listLoadBalancerRuleInstances
|
||||
from marvin.cloudstackAPI import assignToLoadBalancerRule
|
||||
|
||||
class LoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createLoadBalancerRule.createLoadBalancerRuleCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerrule = apiclient.createLoadBalancerRule(cmd)
|
||||
return LoadBalancerRule(loadbalancerrule.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listLoadBalancerRules.listLoadBalancerRulesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerrule = apiclient.listLoadBalancerRules(cmd)
|
||||
return map(lambda e: LoadBalancerRule(e.__dict__), loadbalancerrule)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerrule = apiclient.updateLoadBalancerRule(cmd)
|
||||
return loadbalancerrule
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerrule = apiclient.deleteLoadBalancerRule(cmd)
|
||||
return loadbalancerrule
|
||||
|
||||
|
||||
def remove(self, apiclient, virtualmachineids, **kwargs):
|
||||
cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineids = virtualmachineids
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
fromloadbalancerrule = apiclient.removeFromLoadBalancerRule(cmd)
|
||||
return fromloadbalancerrule
|
||||
|
||||
|
||||
def assign(self, apiclient, virtualmachineids, **kwargs):
|
||||
cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineids = virtualmachineids
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
toloadbalancerrule = apiclient.assignToLoadBalancerRule(cmd)
|
||||
return toloadbalancerrule
|
||||
|
||||
|
||||
@classmethod
|
||||
def listInstances(self, apiclient, **kwargs):
|
||||
cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerruleinstances = apiclient.listLoadBalancerRuleInstances(cmd)
|
||||
return map(lambda e: LoadBalancerRule(e.__dict__), loadbalancerruleinstances)
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createNetwork
|
||||
from marvin.cloudstackAPI import listNetworks
|
||||
from marvin.cloudstackAPI import updateNetwork
|
||||
from marvin.cloudstackAPI import restartNetwork
|
||||
from marvin.cloudstackAPI import deleteNetwork
|
||||
|
||||
class Network(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createNetwork.createNetworkCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
network = apiclient.createNetwork(cmd)
|
||||
return Network(network.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listNetworks.listNetworksCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
network = apiclient.listNetworks(cmd)
|
||||
return map(lambda e: Network(e.__dict__), network)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateNetwork.updateNetworkCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
network = apiclient.updateNetwork(cmd)
|
||||
return network
|
||||
|
||||
|
||||
def restart(self, apiclient, **kwargs):
|
||||
cmd = restartNetwork.restartNetworkCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
network = apiclient.restartNetwork(cmd)
|
||||
return network
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteNetwork.deleteNetworkCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
network = apiclient.deleteNetwork(cmd)
|
||||
return network
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createNetworkACL
|
||||
from marvin.cloudstackAPI import listNetworkACLs
|
||||
from marvin.cloudstackAPI import deleteNetworkACL
|
||||
|
||||
class NetworkACL(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createNetworkACL.createNetworkACLCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkacl = apiclient.createNetworkACL(cmd)
|
||||
return NetworkACL(networkacl.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listNetworkACLs.listNetworkACLsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkacl = apiclient.listNetworkACLs(cmd)
|
||||
return map(lambda e: NetworkACL(e.__dict__), networkacl)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteNetworkACL.deleteNetworkACLCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkacl = apiclient.deleteNetworkACL(cmd)
|
||||
return networkacl
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addNetworkDevice
|
||||
from marvin.cloudstackAPI import listNetworkDevice
|
||||
from marvin.cloudstackAPI import deleteNetworkDevice
|
||||
|
||||
class NetworkDevice(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, **kwargs):
|
||||
cmd = addNetworkDevice.addNetworkDeviceCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkdevice = apiclient.addNetworkDevice(cmd)
|
||||
return networkdevice
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listNetworkDevice.listNetworkDeviceCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkdevice = apiclient.listNetworkDevice(cmd)
|
||||
return map(lambda e: NetworkDevice(e.__dict__), networkdevice)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteNetworkDevice.deleteNetworkDeviceCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkdevice = apiclient.deleteNetworkDevice(cmd)
|
||||
return networkdevice
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createNetworkOffering
|
||||
from marvin.cloudstackAPI import listNetworkOfferings
|
||||
from marvin.cloudstackAPI import updateNetworkOffering
|
||||
from marvin.cloudstackAPI import deleteNetworkOffering
|
||||
|
||||
class NetworkOffering(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createNetworkOffering.createNetworkOfferingCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkoffering = apiclient.createNetworkOffering(cmd)
|
||||
return NetworkOffering(networkoffering.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listNetworkOfferings.listNetworkOfferingsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkoffering = apiclient.listNetworkOfferings(cmd)
|
||||
return map(lambda e: NetworkOffering(e.__dict__), networkoffering)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateNetworkOffering.updateNetworkOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkoffering = apiclient.updateNetworkOffering(cmd)
|
||||
return networkoffering
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteNetworkOffering.deleteNetworkOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkoffering = apiclient.deleteNetworkOffering(cmd)
|
||||
return networkoffering
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addNetworkServiceProvider
|
||||
from marvin.cloudstackAPI import listNetworkServiceProviders
|
||||
from marvin.cloudstackAPI import updateNetworkServiceProvider
|
||||
from marvin.cloudstackAPI import deleteNetworkServiceProvider
|
||||
|
||||
class NetworkServiceProvider(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, physicalnetworkid, name, **kwargs):
|
||||
cmd = addNetworkServiceProvider.addNetworkServiceProviderCmd()
|
||||
cmd.id = self.id
|
||||
cmd.name = name
|
||||
cmd.physicalnetworkid = physicalnetworkid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkserviceprovider = apiclient.addNetworkServiceProvider(cmd)
|
||||
return networkserviceprovider
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkserviceprovider = apiclient.listNetworkServiceProviders(cmd)
|
||||
return map(lambda e: NetworkServiceProvider(e.__dict__), networkserviceprovider)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkserviceprovider = apiclient.updateNetworkServiceProvider(cmd)
|
||||
return networkserviceprovider
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteNetworkServiceProvider.deleteNetworkServiceProviderCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
networkserviceprovider = apiclient.deleteNetworkServiceProvider(cmd)
|
||||
return networkserviceprovider
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listNics
|
||||
from marvin.cloudstackAPI import addIpToNic
|
||||
from marvin.cloudstackAPI import removeIpFromNic
|
||||
|
||||
class Nic(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, virtualmachineid, **kwargs):
|
||||
cmd = listNics.listNicsCmd()
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
nics = apiclient.listNics(cmd)
|
||||
return map(lambda e: Nic(e.__dict__), nics)
|
||||
|
||||
|
||||
def add_ip(self, apiclient, **kwargs):
|
||||
cmd = addIpToNic.addIpToNicCmd()
|
||||
cmd.nicid = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iptonic = apiclient.addIpToNic(cmd)
|
||||
return iptonic
|
||||
|
||||
|
||||
def remove_ip(self, apiclient, **kwargs):
|
||||
cmd = removeIpFromNic.removeIpFromNicCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipfromnic = apiclient.removeIpFromNic(cmd)
|
||||
return ipfromnic
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addNiciraNvpDevice
|
||||
from marvin.cloudstackAPI import listNiciraNvpDevices
|
||||
from marvin.cloudstackAPI import deleteNiciraNvpDevice
|
||||
from marvin.cloudstackAPI import listNiciraNvpDeviceNetworks
|
||||
|
||||
class NiciraNvpDevice(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, username, physicalnetworkid, password, hostname, transportzoneuuid, **kwargs):
|
||||
cmd = addNiciraNvpDevice.addNiciraNvpDeviceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.hostname = hostname
|
||||
cmd.password = password
|
||||
cmd.physicalnetworkid = physicalnetworkid
|
||||
cmd.transportzoneuuid = transportzoneuuid
|
||||
cmd.username = username
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
niciranvpdevice = apiclient.addNiciraNvpDevice(cmd)
|
||||
return niciranvpdevice
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listNiciraNvpDevices.listNiciraNvpDevicesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
niciranvpdevice = apiclient.listNiciraNvpDevices(cmd)
|
||||
return map(lambda e: NiciraNvpDevice(e.__dict__), niciranvpdevice)
|
||||
|
||||
|
||||
def delete(self, apiclient, nvpdeviceid, **kwargs):
|
||||
cmd = deleteNiciraNvpDevice.deleteNiciraNvpDeviceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.nvpdeviceid = nvpdeviceid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
niciranvpdevice = apiclient.deleteNiciraNvpDevice(cmd)
|
||||
return niciranvpdevice
|
||||
|
||||
@classmethod
|
||||
def listNetworks(self, apiclient, nvpdeviceid, **kwargs):
|
||||
cmd = listNiciraNvpDeviceNetworks.listNiciraNvpDeviceNetworksCmd()
|
||||
cmd.nvpdeviceid = nvpdeviceid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
niciranvpdevicenetworks = apiclient.listNiciraNvpDeviceNetworks(cmd)
|
||||
return map(lambda e: NiciraNvpDevice(e.__dict__), niciranvpdevicenetworks)
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listOsCategories
|
||||
|
||||
class OsCategories(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listOsCategories.listOsCategoriesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
oscategories = apiclient.listOsCategories(cmd)
|
||||
return map(lambda e: OsCategories(e.__dict__), oscategories)
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listOsTypes
|
||||
|
||||
class OsTypes(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listOsTypes.listOsTypesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ostypes = apiclient.listOsTypes(cmd)
|
||||
return map(lambda e: OsTypes(e.__dict__), ostypes)
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createPhysicalNetwork
|
||||
from marvin.cloudstackAPI import listPhysicalNetworks
|
||||
from marvin.cloudstackAPI import updatePhysicalNetwork
|
||||
from marvin.cloudstackAPI import deletePhysicalNetwork
|
||||
|
||||
class PhysicalNetwork(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createPhysicalNetwork.createPhysicalNetworkCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
physicalnetwork = apiclient.createPhysicalNetwork(cmd)
|
||||
return PhysicalNetwork(physicalnetwork.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listPhysicalNetworks.listPhysicalNetworksCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
physicalnetwork = apiclient.listPhysicalNetworks(cmd)
|
||||
return map(lambda e: PhysicalNetwork(e.__dict__), physicalnetwork)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
physicalnetwork = apiclient.updatePhysicalNetwork(cmd)
|
||||
return physicalnetwork
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
physicalnetwork = apiclient.deletePhysicalNetwork(cmd)
|
||||
return physicalnetwork
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createPod
|
||||
from marvin.cloudstackAPI import listPods
|
||||
from marvin.cloudstackAPI import updatePod
|
||||
from marvin.cloudstackAPI import deletePod
|
||||
|
||||
class Pod(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createPod.createPodCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
pod = apiclient.createPod(cmd)
|
||||
return Pod(pod.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listPods.listPodsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
pod = apiclient.listPods(cmd)
|
||||
return map(lambda e: Pod(e.__dict__), pod)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updatePod.updatePodCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
pod = apiclient.updatePod(cmd)
|
||||
return pod
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePod.deletePodCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
pod = apiclient.deletePod(cmd)
|
||||
return pod
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createPortForwardingRule
|
||||
from marvin.cloudstackAPI import listPortForwardingRules
|
||||
from marvin.cloudstackAPI import updatePortForwardingRule
|
||||
from marvin.cloudstackAPI import deletePortForwardingRule
|
||||
|
||||
class PortForwardingRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createPortForwardingRule.createPortForwardingRuleCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
portforwardingrule = apiclient.createPortForwardingRule(cmd)
|
||||
return PortForwardingRule(portforwardingrule.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listPortForwardingRules.listPortForwardingRulesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
portforwardingrule = apiclient.listPortForwardingRules(cmd)
|
||||
return map(lambda e: PortForwardingRule(e.__dict__), portforwardingrule)
|
||||
|
||||
|
||||
def update(self, apiclient, publicport, protocol, ipaddressid, privateport, **kwargs):
|
||||
cmd = updatePortForwardingRule.updatePortForwardingRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.ipaddressid = ipaddressid
|
||||
cmd.privateport = privateport
|
||||
cmd.protocol = protocol
|
||||
cmd.publicport = publicport
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
portforwardingrule = apiclient.updatePortForwardingRule(cmd)
|
||||
return portforwardingrule
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePortForwardingRule.deletePortForwardingRuleCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
portforwardingrule = apiclient.deletePortForwardingRule(cmd)
|
||||
return portforwardingrule
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createPrivateGateway
|
||||
from marvin.cloudstackAPI import listPrivateGateways
|
||||
from marvin.cloudstackAPI import deletePrivateGateway
|
||||
|
||||
class PrivateGateway(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createPrivateGateway.createPrivateGatewayCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
privategateway = apiclient.createPrivateGateway(cmd)
|
||||
return PrivateGateway(privategateway.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listPrivateGateways.listPrivateGatewaysCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
privategateway = apiclient.listPrivateGateways(cmd)
|
||||
return map(lambda e: PrivateGateway(e.__dict__), privategateway)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePrivateGateway.deletePrivateGatewayCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
privategateway = apiclient.deletePrivateGateway(cmd)
|
||||
return privategateway
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import suspendProject
|
||||
from marvin.cloudstackAPI import createProject
|
||||
from marvin.cloudstackAPI import listProjects
|
||||
from marvin.cloudstackAPI import updateProject
|
||||
from marvin.cloudstackAPI import activateProject
|
||||
from marvin.cloudstackAPI import deleteProject
|
||||
from marvin.cloudstackAPI import deleteAccountFromProject
|
||||
from marvin.cloudstackAPI import addAccountToProject
|
||||
from marvin.cloudstackAPI import listProjectAccounts
|
||||
|
||||
class Project(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def suspend(self, apiclient, **kwargs):
|
||||
cmd = suspendProject.suspendProjectCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.suspendProject(cmd)
|
||||
return project
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createProject.createProjectCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.createProject(cmd)
|
||||
return Project(project.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listProjects.listProjectsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.listProjects(cmd)
|
||||
return map(lambda e: Project(e.__dict__), project)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateProject.updateProjectCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.updateProject(cmd)
|
||||
return project
|
||||
|
||||
|
||||
def activate(self, apiclient, **kwargs):
|
||||
cmd = activateProject.activateProjectCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.activateProject(cmd)
|
||||
return project
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteProject.deleteProjectCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.deleteProject(cmd)
|
||||
return project
|
||||
|
||||
|
||||
def delete_account(self, apiclient, projectid, **kwargs):
|
||||
cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.projectid = projectid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
deletefromproject = apiclient.deleteAccountFromProject(cmd)
|
||||
return deletefromproject
|
||||
|
||||
|
||||
def add_account(self, apiclient, projectid, **kwargs):
|
||||
cmd = addAccountToProject.addAccountToProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.projectid = projectid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
accounttoproject = apiclient.addAccountToProject(cmd)
|
||||
return accounttoproject
|
||||
|
||||
@classmethod
|
||||
def list_accounts(self, apiclient, projectid, **kwargs):
|
||||
cmd = listProjectAccounts.listProjectAccountsCmd()
|
||||
cmd.projectid = projectid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
projectaccounts = apiclient.listProjectAccounts(cmd)
|
||||
return map(lambda e: Project(e.__dict__), projectaccounts)
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listProjectInvitations
|
||||
from marvin.cloudstackAPI import updateProjectInvitation
|
||||
from marvin.cloudstackAPI import deleteProjectInvitation
|
||||
|
||||
class ProjectInvitation(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listProjectInvitations.listProjectInvitationsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
projectinvitation = apiclient.listProjectInvitations(cmd)
|
||||
return map(lambda e: ProjectInvitation(e.__dict__), projectinvitation)
|
||||
|
||||
|
||||
def update(self, apiclient, projectid, **kwargs):
|
||||
cmd = updateProjectInvitation.updateProjectInvitationCmd()
|
||||
cmd.id = self.id
|
||||
cmd.projectid = projectid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
projectinvitation = apiclient.updateProjectInvitation(cmd)
|
||||
return projectinvitation
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteProjectInvitation.deleteProjectInvitationCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
projectinvitation = apiclient.deleteProjectInvitation(cmd)
|
||||
return projectinvitation
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addRegion
|
||||
from marvin.cloudstackAPI import listRegions
|
||||
from marvin.cloudstackAPI import updateRegion
|
||||
from marvin.cloudstackAPI import removeRegion
|
||||
|
||||
class Region(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, endpoint, name, **kwargs):
|
||||
cmd = addRegion.addRegionCmd()
|
||||
cmd.id = self.id
|
||||
cmd.endpoint = endpoint
|
||||
cmd.name = name
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
region = apiclient.addRegion(cmd)
|
||||
return region
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listRegions.listRegionsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
region = apiclient.listRegions(cmd)
|
||||
return map(lambda e: Region(e.__dict__), region)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateRegion.updateRegionCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
region = apiclient.updateRegion(cmd)
|
||||
return region
|
||||
|
||||
|
||||
def remove(self, apiclient, **kwargs):
|
||||
cmd = removeRegion.removeRegionCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
region = apiclient.removeRegion(cmd)
|
||||
return region
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createRemoteAccessVpn
|
||||
from marvin.cloudstackAPI import listRemoteAccessVpns
|
||||
from marvin.cloudstackAPI import deleteRemoteAccessVpn
|
||||
|
||||
class RemoteAccessVpn(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
remoteaccessvpn = apiclient.createRemoteAccessVpn(cmd)
|
||||
return RemoteAccessVpn(remoteaccessvpn.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, publicipid, **kwargs):
|
||||
cmd = listRemoteAccessVpns.listRemoteAccessVpnsCmd()
|
||||
cmd.publicipid = publicipid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
remoteaccessvpn = apiclient.listRemoteAccessVpns(cmd)
|
||||
return map(lambda e: RemoteAccessVpn(e.__dict__), remoteaccessvpn)
|
||||
|
||||
|
||||
def delete(self, apiclient, publicipid, **kwargs):
|
||||
cmd = deleteRemoteAccessVpn.deleteRemoteAccessVpnCmd()
|
||||
cmd.id = self.id
|
||||
cmd.publicipid = publicipid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
remoteaccessvpn = apiclient.deleteRemoteAccessVpn(cmd)
|
||||
return remoteaccessvpn
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import updateResourceCount
|
||||
|
||||
class ResourceCount(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def update(self, apiclient, domainid, **kwargs):
|
||||
cmd = updateResourceCount.updateResourceCountCmd()
|
||||
cmd.id = self.id
|
||||
cmd.domainid = domainid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
resourcecount = apiclient.updateResourceCount(cmd)
|
||||
return resourcecount
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listResourceLimits
|
||||
from marvin.cloudstackAPI import updateResourceLimit
|
||||
|
||||
class ResourceLimit(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listResourceLimits.listResourceLimitsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
resourcelimit = apiclient.listResourceLimits(cmd)
|
||||
return map(lambda e: ResourceLimit(e.__dict__), resourcelimit)
|
||||
|
||||
|
||||
def update(self, apiclient, resourcetype, **kwargs):
|
||||
cmd = updateResourceLimit.updateResourceLimitCmd()
|
||||
cmd.id = self.id
|
||||
cmd.resourcetype = resourcetype
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
resourcelimit = apiclient.updateResourceLimit(cmd)
|
||||
return resourcelimit
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import destroyRouter
|
||||
from marvin.cloudstackAPI import listRouters
|
||||
from marvin.cloudstackAPI import stopRouter
|
||||
from marvin.cloudstackAPI import rebootRouter
|
||||
from marvin.cloudstackAPI import startRouter
|
||||
|
||||
class Router(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def destroy(self, apiclient, **kwargs):
|
||||
cmd = destroyRouter.destroyRouterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
router = apiclient.destroyRouter(cmd)
|
||||
return router
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listRouters.listRoutersCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
router = apiclient.listRouters(cmd)
|
||||
return map(lambda e: Router(e.__dict__), router)
|
||||
|
||||
|
||||
def stop(self, apiclient, **kwargs):
|
||||
cmd = stopRouter.stopRouterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
router = apiclient.stopRouter(cmd)
|
||||
return router
|
||||
|
||||
|
||||
def reboot(self, apiclient, **kwargs):
|
||||
cmd = rebootRouter.rebootRouterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
router = apiclient.rebootRouter(cmd)
|
||||
return router
|
||||
|
||||
|
||||
def start(self, apiclient, **kwargs):
|
||||
cmd = startRouter.startRouterCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
router = apiclient.startRouter(cmd)
|
||||
return router
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addS3
|
||||
from marvin.cloudstackAPI import listS3s
|
||||
|
||||
class S3(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, secretkey, accesskey, bucket, **kwargs):
|
||||
cmd = addS3.addS3Cmd()
|
||||
cmd.id = self.id
|
||||
cmd.accesskey = accesskey
|
||||
cmd.bucket = bucket
|
||||
cmd.secretkey = secretkey
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
s3 = apiclient.addS3(cmd)
|
||||
return s3
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listS3s.listS3sCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
s3 = apiclient.listS3s(cmd)
|
||||
return map(lambda e: S3(e.__dict__), s3)
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createSSHKeyPair
|
||||
from marvin.cloudstackAPI import registerSSHKeyPair
|
||||
from marvin.cloudstackAPI import listSSHKeyPairs
|
||||
from marvin.cloudstackAPI import deleteSSHKeyPair
|
||||
|
||||
class SSHKeyPair(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createSSHKeyPair.createSSHKeyPairCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
sshkeypair = apiclient.createSSHKeyPair(cmd)
|
||||
return SSHKeyPair(sshkeypair.__dict__)
|
||||
|
||||
|
||||
def register(self, apiclient, publickey, name, **kwargs):
|
||||
cmd = registerSSHKeyPair.registerSSHKeyPairCmd()
|
||||
cmd.id = self.id
|
||||
cmd.name = name
|
||||
cmd.publickey = publickey
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
sshkeypair = apiclient.registerSSHKeyPair(cmd)
|
||||
return sshkeypair
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listSSHKeyPairs.listSSHKeyPairsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
sshkeypair = apiclient.listSSHKeyPairs(cmd)
|
||||
return map(lambda e: SSHKeyPair(e.__dict__), sshkeypair)
|
||||
|
||||
|
||||
def delete(self, apiclient, name, **kwargs):
|
||||
cmd = deleteSSHKeyPair.deleteSSHKeyPairCmd()
|
||||
cmd.id = self.id
|
||||
cmd.name = name
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
sshkeypair = apiclient.deleteSSHKeyPair(cmd)
|
||||
return sshkeypair
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addSecondaryStorage
|
||||
|
||||
class SecondaryStorage(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, url, **kwargs):
|
||||
cmd = addSecondaryStorage.addSecondaryStorageCmd()
|
||||
cmd.id = self.id
|
||||
cmd.url = url
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
secondarystorage = apiclient.addSecondaryStorage(cmd)
|
||||
return secondarystorage
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createSecurityGroup
|
||||
from marvin.cloudstackAPI import listSecurityGroups
|
||||
from marvin.cloudstackAPI import deleteSecurityGroup
|
||||
from marvin.cloudstackAPI import revokeSecurityGroupEgress
|
||||
from marvin.cloudstackAPI import revokeSecurityGroupIngress
|
||||
from marvin.cloudstackAPI import authorizeSecurityGroupEgress
|
||||
from marvin.cloudstackAPI import authorizeSecurityGroupIngress
|
||||
|
||||
class SecurityGroup(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createSecurityGroup.createSecurityGroupCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroup = apiclient.createSecurityGroup(cmd)
|
||||
return SecurityGroup(securitygroup.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listSecurityGroups.listSecurityGroupsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroup = apiclient.listSecurityGroups(cmd)
|
||||
return map(lambda e: SecurityGroup(e.__dict__), securitygroup)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteSecurityGroup.deleteSecurityGroupCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroup = apiclient.deleteSecurityGroup(cmd)
|
||||
return securitygroup
|
||||
|
||||
|
||||
def authorize(self, apiclient, ingress=True, **kwargs):
|
||||
if ingress:
|
||||
cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
|
||||
else:
|
||||
cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
if ingress:
|
||||
return apiclient.authorizeSecurityGroupIngress(cmd)
|
||||
else:
|
||||
return apiclient.authorizeSecurityGroupEgress(cmd)
|
||||
|
||||
|
||||
def revoke(self, apiclient, ingress=True, **kwargs):
|
||||
if ingress:
|
||||
cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
|
||||
else:
|
||||
cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
if ingress:
|
||||
return apiclient.revokeSecurityGroupIngress(cmd)
|
||||
else:
|
||||
return apiclient.revokeSecurityGroupEgress(cmd)
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import changeServiceForRouter
|
||||
|
||||
class ServiceForRouter(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def change(self, apiclient, serviceofferingid, **kwargs):
|
||||
cmd = changeServiceForRouter.changeServiceForRouterCmd()
|
||||
cmd.id = self.id
|
||||
cmd.serviceofferingid = serviceofferingid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceforrouter = apiclient.changeServiceForRouter(cmd)
|
||||
return serviceforrouter
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import changeServiceForSystemVm
|
||||
|
||||
class ServiceForSystemVm(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def change(self, apiclient, serviceofferingid, **kwargs):
|
||||
cmd = changeServiceForSystemVm.changeServiceForSystemVmCmd()
|
||||
cmd.id = self.id
|
||||
cmd.serviceofferingid = serviceofferingid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceforsystemvm = apiclient.changeServiceForSystemVm(cmd)
|
||||
return serviceforsystemvm
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import changeServiceForVirtualMachine
|
||||
|
||||
class ServiceForVirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def change(self, apiclient, serviceofferingid, **kwargs):
|
||||
cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.serviceofferingid = serviceofferingid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceforvirtualmachine = apiclient.changeServiceForVirtualMachine(cmd)
|
||||
return serviceforvirtualmachine
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createServiceOffering
|
||||
from marvin.cloudstackAPI import listServiceOfferings
|
||||
from marvin.cloudstackAPI import updateServiceOffering
|
||||
from marvin.cloudstackAPI import deleteServiceOffering
|
||||
|
||||
class ServiceOffering(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createServiceOffering.createServiceOfferingCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceoffering = apiclient.createServiceOffering(cmd)
|
||||
return ServiceOffering(serviceoffering.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listServiceOfferings.listServiceOfferingsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceoffering = apiclient.listServiceOfferings(cmd)
|
||||
return map(lambda e: ServiceOffering(e.__dict__), serviceoffering)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateServiceOffering.updateServiceOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceoffering = apiclient.updateServiceOffering(cmd)
|
||||
return serviceoffering
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteServiceOffering.deleteServiceOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
serviceoffering = apiclient.deleteServiceOffering(cmd)
|
||||
return serviceoffering
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import configureSimulator
|
||||
|
||||
class Simulator(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def configure(self, apiclient, name, value, **kwargs):
|
||||
cmd = configureSimulator.configureSimulatorCmd()
|
||||
cmd.id = self.id
|
||||
cmd.name = name
|
||||
cmd.value = value
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
simulator = apiclient.configureSimulator(cmd)
|
||||
return simulator
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createSnapshot
|
||||
from marvin.cloudstackAPI import listSnapshots
|
||||
from marvin.cloudstackAPI import deleteSnapshot
|
||||
|
||||
class Snapshot(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createSnapshot.createSnapshotCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshot = apiclient.createSnapshot(cmd)
|
||||
return Snapshot(snapshot.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listSnapshots.listSnapshotsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshot = apiclient.listSnapshots(cmd)
|
||||
return map(lambda e: Snapshot(e.__dict__), snapshot)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteSnapshot.deleteSnapshotCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshot = apiclient.deleteSnapshot(cmd)
|
||||
return snapshot
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createSnapshotPolicy
|
||||
from marvin.cloudstackAPI import listSnapshotPolicies
|
||||
from marvin.cloudstackAPI import deleteSnapshotPolicies
|
||||
|
||||
class SnapshotPolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createSnapshotPolicy.createSnapshotPolicyCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshotpolicy = apiclient.createSnapshotPolicy(cmd)
|
||||
return SnapshotPolicy(snapshotpolicy.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, volumeid, **kwargs):
|
||||
cmd = listSnapshotPolicies.listSnapshotPoliciesCmd()
|
||||
cmd.volumeid = volumeid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshotpolicies = apiclient.listSnapshotPolicies(cmd)
|
||||
return map(lambda e: SnapshotPolicy(e.__dict__), snapshotpolicies)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshotpolicies = apiclient.deleteSnapshotPolicies(cmd)
|
||||
return snapshotpolicies
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import enableStaticNat
|
||||
from marvin.cloudstackAPI import disableStaticNat
|
||||
|
||||
class StaticNat(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def enable(self, apiclient, ipaddressid, virtualmachineid, **kwargs):
|
||||
cmd = enableStaticNat.enableStaticNatCmd()
|
||||
cmd.id = self.id
|
||||
cmd.ipaddressid = ipaddressid
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
staticnat = apiclient.enableStaticNat(cmd)
|
||||
return staticnat
|
||||
|
||||
|
||||
def disable(self, apiclient, ipaddressid, **kwargs):
|
||||
cmd = disableStaticNat.disableStaticNatCmd()
|
||||
cmd.id = self.id
|
||||
cmd.ipaddressid = ipaddressid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
staticnat = apiclient.disableStaticNat(cmd)
|
||||
return staticnat
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createStaticRoute
|
||||
from marvin.cloudstackAPI import listStaticRoutes
|
||||
from marvin.cloudstackAPI import deleteStaticRoute
|
||||
|
||||
class StaticRoute(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createStaticRoute.createStaticRouteCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
staticroute = apiclient.createStaticRoute(cmd)
|
||||
return StaticRoute(staticroute.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listStaticRoutes.listStaticRoutesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
staticroute = apiclient.listStaticRoutes(cmd)
|
||||
return map(lambda e: StaticRoute(e.__dict__), staticroute)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteStaticRoute.deleteStaticRouteCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
staticroute = apiclient.deleteStaticRoute(cmd)
|
||||
return staticroute
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createStorageNetworkIpRange
|
||||
from marvin.cloudstackAPI import listStorageNetworkIpRange
|
||||
from marvin.cloudstackAPI import updateStorageNetworkIpRange
|
||||
from marvin.cloudstackAPI import deleteStorageNetworkIpRange
|
||||
|
||||
class StorageNetworkIpRange(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createStorageNetworkIpRange.createStorageNetworkIpRangeCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagenetworkiprange = apiclient.createStorageNetworkIpRange(cmd)
|
||||
return StorageNetworkIpRange(storagenetworkiprange.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listStorageNetworkIpRange.listStorageNetworkIpRangeCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagenetworkiprange = apiclient.listStorageNetworkIpRange(cmd)
|
||||
return map(lambda e: StorageNetworkIpRange(e.__dict__), storagenetworkiprange)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateStorageNetworkIpRange.updateStorageNetworkIpRangeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagenetworkiprange = apiclient.updateStorageNetworkIpRange(cmd)
|
||||
return storagenetworkiprange
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteStorageNetworkIpRange.deleteStorageNetworkIpRangeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagenetworkiprange = apiclient.deleteStorageNetworkIpRange(cmd)
|
||||
return storagenetworkiprange
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createStoragePool
|
||||
from marvin.cloudstackAPI import listStoragePools
|
||||
from marvin.cloudstackAPI import updateStoragePool
|
||||
from marvin.cloudstackAPI import deleteStoragePool
|
||||
from marvin.cloudstackAPI import cancelStorageMaintenance
|
||||
from marvin.cloudstackAPI import enableStorageMaintenance
|
||||
|
||||
class StoragePool(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createStoragePool.createStoragePoolCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagepool = apiclient.createStoragePool(cmd)
|
||||
return StoragePool(storagepool.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listStoragePools.listStoragePoolsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagepool = apiclient.listStoragePools(cmd)
|
||||
return map(lambda e: StoragePool(e.__dict__), storagepool)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateStoragePool.updateStoragePoolCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagepool = apiclient.updateStoragePool(cmd)
|
||||
return storagepool
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteStoragePool.deleteStoragePoolCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagepool = apiclient.deleteStoragePool(cmd)
|
||||
return storagepool
|
||||
|
||||
|
||||
def cancel_maintenance(self, apiclient, **kwargs):
|
||||
cmd = cancelStorageMaintenance.cancelStorageMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagemaintenance = apiclient.cancelStorageMaintenance(cmd)
|
||||
return storagemaintenance
|
||||
|
||||
|
||||
def enable_maintenance(self, apiclient, **kwargs):
|
||||
cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagemaintenance = apiclient.enableStorageMaintenance(cmd)
|
||||
return storagemaintenance
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listStorageProviders
|
||||
|
||||
class StorageProviders(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, type, **kwargs):
|
||||
cmd = listStorageProviders.listStorageProvidersCmd()
|
||||
cmd.type = type
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storageproviders = apiclient.listStorageProviders(cmd)
|
||||
return map(lambda e: StorageProviders(e.__dict__), storageproviders)
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listSupportedNetworkServices
|
||||
|
||||
class SupportedNetworkServices(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listSupportedNetworkServices.listSupportedNetworkServicesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
supportednetworkservices = apiclient.listSupportedNetworkServices(cmd)
|
||||
return map(lambda e: SupportedNetworkServices(e.__dict__), supportednetworkservices)
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addSwift
|
||||
from marvin.cloudstackAPI import listSwifts
|
||||
|
||||
class Swift(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, url, **kwargs):
|
||||
cmd = addSwift.addSwiftCmd()
|
||||
cmd.id = self.id
|
||||
cmd.url = url
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
swift = apiclient.addSwift(cmd)
|
||||
return swift
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listSwifts.listSwiftsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
swift = apiclient.listSwifts(cmd)
|
||||
return map(lambda e: Swift(e.__dict__), swift)
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import migrateSystemVm
|
||||
from marvin.cloudstackAPI import stopSystemVm
|
||||
from marvin.cloudstackAPI import listSystemVms
|
||||
from marvin.cloudstackAPI import rebootSystemVm
|
||||
from marvin.cloudstackAPI import startSystemVm
|
||||
from marvin.cloudstackAPI import destroySystemVm
|
||||
|
||||
class SystemVm(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def migrate(self, apiclient, hostid, virtualmachineid, **kwargs):
|
||||
cmd = migrateSystemVm.migrateSystemVmCmd()
|
||||
cmd.id = self.id
|
||||
cmd.hostid = hostid
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
systemvm = apiclient.migrateSystemVm(cmd)
|
||||
return systemvm
|
||||
|
||||
|
||||
def stop(self, apiclient, **kwargs):
|
||||
cmd = stopSystemVm.stopSystemVmCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
systemvm = apiclient.stopSystemVm(cmd)
|
||||
return systemvm
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listSystemVms.listSystemVmsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
systemvm = apiclient.listSystemVms(cmd)
|
||||
return map(lambda e: SystemVm(e.__dict__), systemvm)
|
||||
|
||||
|
||||
def reboot(self, apiclient, **kwargs):
|
||||
cmd = rebootSystemVm.rebootSystemVmCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
systemvm = apiclient.rebootSystemVm(cmd)
|
||||
return systemvm
|
||||
|
||||
|
||||
def start(self, apiclient, **kwargs):
|
||||
cmd = startSystemVm.startSystemVmCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
systemvm = apiclient.startSystemVm(cmd)
|
||||
return systemvm
|
||||
|
||||
|
||||
def destroy(self, apiclient, **kwargs):
|
||||
cmd = destroySystemVm.destroySystemVmCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
systemvm = apiclient.destroySystemVm(cmd)
|
||||
return systemvm
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createTags
|
||||
from marvin.cloudstackAPI import listTags
|
||||
from marvin.cloudstackAPI import deleteTags
|
||||
|
||||
class Tags(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createTags.createTagsCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
tags = apiclient.createTags(cmd)
|
||||
return Tags(tags.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listTags.listTagsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
tags = apiclient.listTags(cmd)
|
||||
return map(lambda e: Tags(e.__dict__), tags)
|
||||
|
||||
|
||||
def delete(self, apiclient, resourcetype, resourceids, **kwargs):
|
||||
cmd = deleteTags.deleteTagsCmd()
|
||||
cmd.id = self.id
|
||||
cmd.resourceids = resourceids
|
||||
cmd.resourcetype = resourcetype
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
tags = apiclient.deleteTags(cmd)
|
||||
return tags
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import prepareTemplate
|
||||
from marvin.cloudstackAPI import createTemplate
|
||||
from marvin.cloudstackAPI import registerTemplate
|
||||
from marvin.cloudstackAPI import listTemplates
|
||||
from marvin.cloudstackAPI import updateTemplate
|
||||
from marvin.cloudstackAPI import copyTemplate
|
||||
from marvin.cloudstackAPI import extractTemplate
|
||||
from marvin.cloudstackAPI import deleteTemplate
|
||||
|
||||
class Template(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def prepare(self, apiclient, zoneid, templateid, **kwargs):
|
||||
cmd = prepareTemplate.prepareTemplateCmd()
|
||||
cmd.id = self.id
|
||||
cmd.templateid = templateid
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.prepareTemplate(cmd)
|
||||
return template
|
||||
|
||||
|
||||
def template_of_vm(self, apiclient, name, displaytext, ostypeid, **kwargs):
|
||||
cmd = createTemplate.createTemplateCmd()
|
||||
cmd.id = self.id
|
||||
cmd.name = name
|
||||
cmd.displaytext = displaytext
|
||||
cmd.ostypeid = ostypeid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.createTemplate(cmd)
|
||||
return Template(template.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(self, apiclient, factory, **kwargs):
|
||||
cmd = registerTemplate.registerTemplateCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.registerTemplate(cmd)
|
||||
return template
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, templatefilter, **kwargs):
|
||||
cmd = listTemplates.listTemplatesCmd()
|
||||
cmd.templatefilter = templatefilter
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.listTemplates(cmd)
|
||||
return map(lambda e: Template(e.__dict__), template)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateTemplate.updateTemplateCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.updateTemplate(cmd)
|
||||
return template
|
||||
|
||||
|
||||
def copy(self, apiclient, sourcezoneid, destzoneid, **kwargs):
|
||||
cmd = copyTemplate.copyTemplateCmd()
|
||||
cmd.id = self.id
|
||||
cmd.destzoneid = destzoneid
|
||||
cmd.sourcezoneid = sourcezoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.copyTemplate(cmd)
|
||||
return template
|
||||
|
||||
|
||||
def extract(self, apiclient, mode, **kwargs):
|
||||
cmd = extractTemplate.extractTemplateCmd()
|
||||
cmd.id = self.id
|
||||
cmd.mode = mode
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.extractTemplate(cmd)
|
||||
return template
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteTemplate.deleteTemplateCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
template = apiclient.deleteTemplate(cmd)
|
||||
return template
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listTemplatePermissions
|
||||
from marvin.cloudstackAPI import updateTemplatePermissions
|
||||
|
||||
class TemplatePermissions(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listTemplatePermissions.listTemplatePermissionsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
templatepermissions = apiclient.listTemplatePermissions(cmd)
|
||||
return map(lambda e: TemplatePermissions(e.__dict__), templatepermissions)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateTemplatePermissions.updateTemplatePermissionsCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
templatepermissions = apiclient.updateTemplatePermissions(cmd)
|
||||
return templatepermissions
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addTrafficMonitor
|
||||
from marvin.cloudstackAPI import listTrafficMonitors
|
||||
from marvin.cloudstackAPI import deleteTrafficMonitor
|
||||
|
||||
class TrafficMonitor(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, url, zoneid, **kwargs):
|
||||
cmd = addTrafficMonitor.addTrafficMonitorCmd()
|
||||
cmd.id = self.id
|
||||
cmd.url = url
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
trafficmonitor = apiclient.addTrafficMonitor(cmd)
|
||||
return trafficmonitor
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, zoneid, **kwargs):
|
||||
cmd = listTrafficMonitors.listTrafficMonitorsCmd()
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
trafficmonitor = apiclient.listTrafficMonitors(cmd)
|
||||
return map(lambda e: TrafficMonitor(e.__dict__), trafficmonitor)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteTrafficMonitor.deleteTrafficMonitorCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
trafficmonitor = apiclient.deleteTrafficMonitor(cmd)
|
||||
return trafficmonitor
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addTrafficType
|
||||
from marvin.cloudstackAPI import listTrafficTypes
|
||||
from marvin.cloudstackAPI import updateTrafficType
|
||||
from marvin.cloudstackAPI import deleteTrafficType
|
||||
|
||||
class TrafficType(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, traffictype, physicalnetworkid, **kwargs):
|
||||
cmd = addTrafficType.addTrafficTypeCmd()
|
||||
cmd.id = self.id
|
||||
cmd.physicalnetworkid = physicalnetworkid
|
||||
cmd.traffictype = traffictype
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
traffictype = apiclient.addTrafficType(cmd)
|
||||
return traffictype
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, physicalnetworkid, **kwargs):
|
||||
cmd = listTrafficTypes.listTrafficTypesCmd()
|
||||
cmd.physicalnetworkid = physicalnetworkid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
traffictype = apiclient.listTrafficTypes(cmd)
|
||||
return map(lambda e: TrafficType(e.__dict__), traffictype)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateTrafficType.updateTrafficTypeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
traffictype = apiclient.updateTrafficType(cmd)
|
||||
return traffictype
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteTrafficType.deleteTrafficTypeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
traffictype = apiclient.deleteTrafficType(cmd)
|
||||
return traffictype
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listTrafficTypeImplementors
|
||||
|
||||
class TrafficTypeImplementors(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listTrafficTypeImplementors.listTrafficTypeImplementorsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
traffictypeimplementors = apiclient.listTrafficTypeImplementors(cmd)
|
||||
return map(lambda e: TrafficTypeImplementors(e.__dict__), traffictypeimplementors)
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listUsageRecords
|
||||
from marvin.cloudstackAPI import generateUsageRecords
|
||||
|
||||
class UsageRecords(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, startdate, enddate, **kwargs):
|
||||
cmd = listUsageRecords.listUsageRecordsCmd()
|
||||
cmd.enddate = enddate
|
||||
cmd.startdate = startdate
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
usagerecords = apiclient.listUsageRecords(cmd)
|
||||
return map(lambda e: UsageRecords(e.__dict__), usagerecords)
|
||||
|
||||
|
||||
def generate(self, apiclient, startdate, enddate, **kwargs):
|
||||
cmd = generateUsageRecords.generateUsageRecordsCmd()
|
||||
cmd.id = self.id
|
||||
cmd.enddate = enddate
|
||||
cmd.startdate = startdate
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
usagerecords = apiclient.generateUsageRecords(cmd)
|
||||
return usagerecords
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listUsageTypes
|
||||
|
||||
class UsageTypes(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listUsageTypes.listUsageTypesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
usagetypes = apiclient.listUsageTypes(cmd)
|
||||
return map(lambda e: UsageTypes(e.__dict__), usagetypes)
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import enableUser
|
||||
from marvin.cloudstackAPI import getUser
|
||||
from marvin.cloudstackAPI import lockUser
|
||||
from marvin.cloudstackAPI import createUser
|
||||
from marvin.cloudstackAPI import listUsers
|
||||
from marvin.cloudstackAPI import updateUser
|
||||
from marvin.cloudstackAPI import disableUser
|
||||
from marvin.cloudstackAPI import deleteUser
|
||||
from marvin.cloudstackAPI import registerUserKeys
|
||||
|
||||
class User(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def enable(self, apiclient, **kwargs):
|
||||
cmd = enableUser.enableUserCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.enableUser(cmd)
|
||||
return user
|
||||
|
||||
|
||||
def get(self, apiclient, userapikey, **kwargs):
|
||||
cmd = getUser.getUserCmd()
|
||||
cmd.id = self.id
|
||||
cmd.userapikey = userapikey
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.getUser(cmd)
|
||||
return user
|
||||
|
||||
|
||||
def lock(self, apiclient, **kwargs):
|
||||
cmd = lockUser.lockUserCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.lockUser(cmd)
|
||||
return user
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createUser.createUserCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.createUser(cmd)
|
||||
return User(user.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listUsers.listUsersCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.listUsers(cmd)
|
||||
return map(lambda e: User(e.__dict__), user)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateUser.updateUserCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.updateUser(cmd)
|
||||
return user
|
||||
|
||||
|
||||
def disable(self, apiclient, **kwargs):
|
||||
cmd = disableUser.disableUserCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.disableUser(cmd)
|
||||
return user
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteUser.deleteUserCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
user = apiclient.deleteUser(cmd)
|
||||
return user
|
||||
|
||||
|
||||
def register_userkeys(self, apiclient, **kwargs):
|
||||
cmd = registerUserKeys.registerUserKeysCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
userkeys = apiclient.registerUserKeys(cmd)
|
||||
return userkeys
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import getVMPassword
|
||||
|
||||
class VMPassword(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def get(self, apiclient, **kwargs):
|
||||
cmd = getVMPassword.getVMPasswordCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vmpassword = apiclient.getVMPassword(cmd)
|
||||
return vmpassword
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVMSnapshot
|
||||
from marvin.cloudstackAPI import listVMSnapshot
|
||||
from marvin.cloudstackAPI import deleteVMSnapshot
|
||||
|
||||
class VMSnapshot(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVMSnapshot.createVMSnapshotCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vmsnapshot = apiclient.createVMSnapshot(cmd)
|
||||
return VMSnapshot(vmsnapshot.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVMSnapshot.listVMSnapshotCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vmsnapshot = apiclient.listVMSnapshot(cmd)
|
||||
return map(lambda e: VMSnapshot(e.__dict__), vmsnapshot)
|
||||
|
||||
|
||||
def delete(self, apiclient, vmsnapshotid, **kwargs):
|
||||
cmd = deleteVMSnapshot.deleteVMSnapshotCmd()
|
||||
cmd.id = self.id
|
||||
cmd.vmsnapshotid = vmsnapshotid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vmsnapshot = apiclient.deleteVMSnapshot(cmd)
|
||||
return vmsnapshot
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVPC
|
||||
from marvin.cloudstackAPI import listVPCs
|
||||
from marvin.cloudstackAPI import updateVPC
|
||||
from marvin.cloudstackAPI import restartVPC
|
||||
from marvin.cloudstackAPI import deleteVPC
|
||||
|
||||
class VPC(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVPC.createVPCCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpc = apiclient.createVPC(cmd)
|
||||
return VPC(vpc.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVPCs.listVPCsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpc = apiclient.listVPCs(cmd)
|
||||
return map(lambda e: VPC(e.__dict__), vpc)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateVPC.updateVPCCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpc = apiclient.updateVPC(cmd)
|
||||
return vpc
|
||||
|
||||
|
||||
def restart(self, apiclient, **kwargs):
|
||||
cmd = restartVPC.restartVPCCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpc = apiclient.restartVPC(cmd)
|
||||
return vpc
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVPC.deleteVPCCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpc = apiclient.deleteVPC(cmd)
|
||||
return vpc
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVPCOffering
|
||||
from marvin.cloudstackAPI import listVPCOfferings
|
||||
from marvin.cloudstackAPI import updateVPCOffering
|
||||
from marvin.cloudstackAPI import deleteVPCOffering
|
||||
|
||||
class VPCOffering(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVPCOffering.createVPCOfferingCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpcoffering = apiclient.createVPCOffering(cmd)
|
||||
return VPCOffering(vpcoffering.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVPCOfferings.listVPCOfferingsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpcoffering = apiclient.listVPCOfferings(cmd)
|
||||
return map(lambda e: VPCOffering(e.__dict__), vpcoffering)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateVPCOffering.updateVPCOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpcoffering = apiclient.updateVPCOffering(cmd)
|
||||
return vpcoffering
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVPCOffering.deleteVPCOfferingCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpcoffering = apiclient.deleteVPCOffering(cmd)
|
||||
return vpcoffering
|
||||
|
|
@ -1,177 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import restoreVirtualMachine
|
||||
from marvin.cloudstackAPI import scaleVirtualMachine
|
||||
from marvin.cloudstackAPI import deployVirtualMachine
|
||||
from marvin.cloudstackAPI import migrateVirtualMachine
|
||||
from marvin.cloudstackAPI import listVirtualMachines
|
||||
from marvin.cloudstackAPI import stopVirtualMachine
|
||||
from marvin.cloudstackAPI import rebootVirtualMachine
|
||||
from marvin.cloudstackAPI import updateVirtualMachine
|
||||
from marvin.cloudstackAPI import startVirtualMachine
|
||||
from marvin.cloudstackAPI import destroyVirtualMachine
|
||||
from marvin.cloudstackAPI import assignVirtualMachine
|
||||
from marvin.cloudstackAPI import addNicToVirtualMachine
|
||||
from marvin.cloudstackAPI import removeNicFromVirtualMachine
|
||||
from marvin.cloudstackAPI import resetPasswordForVirtualMachine
|
||||
from marvin.cloudstackAPI import resetSSHKeyForVirtualMachine
|
||||
from marvin.cloudstackAPI import updateDefaultNicForVirtualMachine
|
||||
|
||||
class VirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def restore(self, apiclient, virtualmachineid, **kwargs):
|
||||
cmd = restoreVirtualMachine.restoreVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.restoreVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def scale(self, apiclient, serviceofferingid, **kwargs):
|
||||
cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.serviceofferingid = serviceofferingid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.scaleVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
@classmethod
|
||||
def deploy(cls, apiclient, factory, **kwargs):
|
||||
cmd = deployVirtualMachine.deployVirtualMachineCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.deployVirtualMachine(cmd)
|
||||
return VirtualMachine(virtualmachine.__dict__)
|
||||
|
||||
|
||||
def migrate(self, apiclient, virtualmachineid, **kwargs):
|
||||
cmd = migrateVirtualMachine.migrateVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.migrateVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVirtualMachines.listVirtualMachinesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.listVirtualMachines(cmd)
|
||||
return map(lambda e: VirtualMachine(e.__dict__), virtualmachine)
|
||||
|
||||
|
||||
def stop(self, apiclient, **kwargs):
|
||||
cmd = stopVirtualMachine.stopVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.stopVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def reboot(self, apiclient, **kwargs):
|
||||
cmd = rebootVirtualMachine.rebootVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.rebootVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateVirtualMachine.updateVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.updateVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def start(self, apiclient, **kwargs):
|
||||
cmd = startVirtualMachine.startVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.startVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def destroy(self, apiclient, **kwargs):
|
||||
cmd = destroyVirtualMachine.destroyVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.destroyVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def assign(self, apiclient, account, domainid, virtualmachineid, **kwargs):
|
||||
cmd = assignVirtualMachine.assignVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.account = account
|
||||
cmd.domainid = domainid
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.assignVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
def remove_nic(self, apiclient, nicid, **kwargs):
|
||||
cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
|
||||
cmd.virtualmachineid = self.id
|
||||
cmd.nicid = nicid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
nicfromvirtualmachine = apiclient.removeNicFromVirtualMachine(cmd)
|
||||
return nicfromvirtualmachine
|
||||
|
||||
|
||||
def add_nic(self, apiclient, networkid, **kwargs):
|
||||
cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd()
|
||||
cmd.virtualmachineid = self.id
|
||||
cmd.networkid = networkid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
nictovirtualmachine = apiclient.addNicToVirtualMachine(cmd)
|
||||
return nictovirtualmachine
|
||||
|
||||
|
||||
def update_default_nic(self, apiclient, nicid, **kwargs):
|
||||
cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
|
||||
cmd.virtualmachineid = self.id
|
||||
cmd.nicid = nicid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
defaultnicforvirtualmachine = apiclient.updateDefaultNicForVirtualMachine(cmd)
|
||||
return defaultnicforvirtualmachine
|
||||
|
||||
|
||||
def reset_password(self, apiclient, **kwargs):
|
||||
cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
passwordforvirtualmachine = apiclient.resetPasswordForVirtualMachine(cmd)
|
||||
return passwordforvirtualmachine
|
||||
|
||||
|
||||
def reset_sshkey(self, apiclient, keypair, **kwargs):
|
||||
cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.keypair = keypair
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
sshkeyforvirtualmachine = apiclient.resetSSHKeyForVirtualMachine(cmd)
|
||||
return sshkeyforvirtualmachine
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVirtualRouterElement
|
||||
from marvin.cloudstackAPI import listVirtualRouterElements
|
||||
from marvin.cloudstackAPI import configureVirtualRouterElement
|
||||
|
||||
class VirtualRouterElement(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVirtualRouterElement.createVirtualRouterElementCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualrouterelement = apiclient.createVirtualRouterElement(cmd)
|
||||
return VirtualRouterElement(virtualrouterelement.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVirtualRouterElements.listVirtualRouterElementsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualrouterelement = apiclient.listVirtualRouterElements(cmd)
|
||||
return map(lambda e: VirtualRouterElement(e.__dict__), virtualrouterelement)
|
||||
|
||||
|
||||
def configure(self, apiclient, enabled, **kwargs):
|
||||
cmd = configureVirtualRouterElement.configureVirtualRouterElementCmd()
|
||||
cmd.id = self.id
|
||||
cmd.enabled = enabled
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualrouterelement = apiclient.configureVirtualRouterElement(cmd)
|
||||
return virtualrouterelement
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVlanIpRange
|
||||
from marvin.cloudstackAPI import listVlanIpRanges
|
||||
from marvin.cloudstackAPI import deleteVlanIpRange
|
||||
|
||||
class VlanIpRange(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVlanIpRange.createVlanIpRangeCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vlaniprange = apiclient.createVlanIpRange(cmd)
|
||||
return VlanIpRange(vlaniprange.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVlanIpRanges.listVlanIpRangesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vlaniprange = apiclient.listVlanIpRanges(cmd)
|
||||
return map(lambda e: VlanIpRange(e.__dict__), vlaniprange)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVlanIpRange.deleteVlanIpRangeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vlaniprange = apiclient.deleteVlanIpRange(cmd)
|
||||
return vlaniprange
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import migrateVolume
|
||||
from marvin.cloudstackAPI import createVolume
|
||||
from marvin.cloudstackAPI import listVolumes
|
||||
from marvin.cloudstackAPI import uploadVolume
|
||||
from marvin.cloudstackAPI import attachVolume
|
||||
from marvin.cloudstackAPI import detachVolume
|
||||
from marvin.cloudstackAPI import extractVolume
|
||||
from marvin.cloudstackAPI import deleteVolume
|
||||
|
||||
class Volume(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def migrate(self, apiclient, storageid, volumeid, **kwargs):
|
||||
cmd = migrateVolume.migrateVolumeCmd()
|
||||
cmd.id = self.id
|
||||
cmd.storageid = storageid
|
||||
cmd.volumeid = volumeid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.migrateVolume(cmd)
|
||||
return volume
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVolume.createVolumeCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.createVolume(cmd)
|
||||
return Volume(volume.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVolumes.listVolumesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.listVolumes(cmd)
|
||||
return map(lambda e: Volume(e.__dict__), volume)
|
||||
|
||||
|
||||
def upload(self, apiclient, url, zoneid, name, format, **kwargs):
|
||||
cmd = uploadVolume.uploadVolumeCmd()
|
||||
cmd.id = self.id
|
||||
cmd.format = format
|
||||
cmd.name = name
|
||||
cmd.url = url
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.uploadVolume(cmd)
|
||||
return volume
|
||||
|
||||
|
||||
def attach(self, apiclient, virtualmachineid, **kwargs):
|
||||
cmd = attachVolume.attachVolumeCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.attachVolume(cmd)
|
||||
return volume
|
||||
|
||||
|
||||
def detach(self, apiclient, **kwargs):
|
||||
cmd = detachVolume.detachVolumeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.detachVolume(cmd)
|
||||
return volume
|
||||
|
||||
|
||||
def extract(self, apiclient, zoneid, mode, **kwargs):
|
||||
cmd = extractVolume.extractVolumeCmd()
|
||||
cmd.id = self.id
|
||||
cmd.mode = mode
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.extractVolume(cmd)
|
||||
return volume
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVolume.deleteVolumeCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
volume = apiclient.deleteVolume(cmd)
|
||||
return volume
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import resetVpnConnection
|
||||
from marvin.cloudstackAPI import createVpnConnection
|
||||
from marvin.cloudstackAPI import listVpnConnections
|
||||
from marvin.cloudstackAPI import deleteVpnConnection
|
||||
|
||||
class VpnConnection(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def reset(self, apiclient, **kwargs):
|
||||
cmd = resetVpnConnection.resetVpnConnectionCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnconnection = apiclient.resetVpnConnection(cmd)
|
||||
return vpnconnection
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVpnConnection.createVpnConnectionCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnconnection = apiclient.createVpnConnection(cmd)
|
||||
return VpnConnection(vpnconnection.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVpnConnections.listVpnConnectionsCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnconnection = apiclient.listVpnConnections(cmd)
|
||||
return map(lambda e: VpnConnection(e.__dict__), vpnconnection)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVpnConnection.deleteVpnConnectionCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnconnection = apiclient.deleteVpnConnection(cmd)
|
||||
return vpnconnection
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVpnCustomerGateway
|
||||
from marvin.cloudstackAPI import listVpnCustomerGateways
|
||||
from marvin.cloudstackAPI import updateVpnCustomerGateway
|
||||
from marvin.cloudstackAPI import deleteVpnCustomerGateway
|
||||
|
||||
class VpnCustomerGateway(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVpnCustomerGateway.createVpnCustomerGatewayCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpncustomergateway = apiclient.createVpnCustomerGateway(cmd)
|
||||
return VpnCustomerGateway(vpncustomergateway.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVpnCustomerGateways.listVpnCustomerGatewaysCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpncustomergateway = apiclient.listVpnCustomerGateways(cmd)
|
||||
return map(lambda e: VpnCustomerGateway(e.__dict__), vpncustomergateway)
|
||||
|
||||
|
||||
def update(self, apiclient, ikepolicy, cidrlist, gateway, ipsecpsk, esppolicy, **kwargs):
|
||||
cmd = updateVpnCustomerGateway.updateVpnCustomerGatewayCmd()
|
||||
cmd.id = self.id
|
||||
cmd.cidrlist = cidrlist
|
||||
cmd.esppolicy = esppolicy
|
||||
cmd.gateway = gateway
|
||||
cmd.ikepolicy = ikepolicy
|
||||
cmd.ipsecpsk = ipsecpsk
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpncustomergateway = apiclient.updateVpnCustomerGateway(cmd)
|
||||
return vpncustomergateway
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVpnCustomerGateway.deleteVpnCustomerGatewayCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpncustomergateway = apiclient.deleteVpnCustomerGateway(cmd)
|
||||
return vpncustomergateway
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createVpnGateway
|
||||
from marvin.cloudstackAPI import listVpnGateways
|
||||
from marvin.cloudstackAPI import deleteVpnGateway
|
||||
|
||||
class VpnGateway(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createVpnGateway.createVpnGatewayCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpngateway = apiclient.createVpnGateway(cmd)
|
||||
return VpnGateway(vpngateway.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVpnGateways.listVpnGatewaysCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpngateway = apiclient.listVpnGateways(cmd)
|
||||
return map(lambda e: VpnGateway(e.__dict__), vpngateway)
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteVpnGateway.deleteVpnGatewayCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpngateway = apiclient.deleteVpnGateway(cmd)
|
||||
return vpngateway
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addVpnUser
|
||||
from marvin.cloudstackAPI import listVpnUsers
|
||||
from marvin.cloudstackAPI import removeVpnUser
|
||||
|
||||
class VpnUser(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, username, password, **kwargs):
|
||||
cmd = addVpnUser.addVpnUserCmd()
|
||||
cmd.id = self.id
|
||||
cmd.password = password
|
||||
cmd.username = username
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnuser = apiclient.addVpnUser(cmd)
|
||||
return vpnuser
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listVpnUsers.listVpnUsersCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnuser = apiclient.listVpnUsers(cmd)
|
||||
return map(lambda e: VpnUser(e.__dict__), vpnuser)
|
||||
|
||||
|
||||
def remove(self, apiclient, username, **kwargs):
|
||||
cmd = removeVpnUser.removeVpnUserCmd()
|
||||
cmd.id = self.id
|
||||
cmd.username = username
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
vpnuser = apiclient.removeVpnUser(cmd)
|
||||
return vpnuser
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from marvin.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createZone
|
||||
from marvin.cloudstackAPI import listZones
|
||||
from marvin.cloudstackAPI import updateZone
|
||||
from marvin.cloudstackAPI import deleteZone
|
||||
|
||||
class Zone(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def create(cls, apiclient, factory, **kwargs):
|
||||
cmd = createZone.createZoneCmd()
|
||||
[setattr(cmd, factoryKey, factoryValue) for factoryKey, factoryValue in factory.__dict__.iteritems()]
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
zone = apiclient.createZone(cmd)
|
||||
return Zone(zone.__dict__)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, **kwargs):
|
||||
cmd = listZones.listZonesCmd()
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
zone = apiclient.listZones(cmd)
|
||||
return map(lambda e: Zone(e.__dict__), zone)
|
||||
|
||||
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateZone.updateZoneCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
zone = apiclient.updateZone(cmd)
|
||||
return zone
|
||||
|
||||
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteZone.deleteZoneCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
zone = apiclient.deleteZone(cmd)
|
||||
return zone
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import factory
|
||||
from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory
|
||||
from marvin.base import Account
|
||||
from marvin.utils import random_gen
|
||||
|
||||
class AccountFactory(CloudStackBaseFactory):
|
||||
|
||||
FACTORY_FOR = Account.Account
|
||||
|
||||
accounttype = None
|
||||
firstname = None
|
||||
lastname = None
|
||||
email = None
|
||||
username = None
|
||||
password = None
|
||||
|
||||
class UserAccountFactory(AccountFactory):
|
||||
accounttype = 0
|
||||
firstname = factory.Sequence(lambda n: random_gen())
|
||||
lastname = factory.Sequence(lambda n: random_gen())
|
||||
email = factory.LazyAttribute(lambda e: '{0}.{1}@cloudstack.org'.format(e.firstname, e.lastname).lower())
|
||||
username = factory.Sequence(lambda n: random_gen())
|
||||
password = 'password'
|
||||
|
||||
|
||||
class AdminAccountFactory(UserAccountFactory):
|
||||
accounttype = 1
|
||||
|
||||
|
||||
class DomainAdminFactory(UserAccountFactory):
|
||||
accounttype = 2
|
||||
domainid = None
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue