mirror of https://github.com/apache/cloudstack.git
marvin_refactor: removing redundant entities
Some entities do not conform to the CRUD format and define extra verbs - eg: markDefaultNicForVirtualMachine, ldapConfig, ldapRemove etc. These are refactored and combined into their respective entities. Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
cb35216f80
commit
aa4651bcc3
|
|
@ -22,6 +22,7 @@ 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):
|
||||
|
||||
|
|
@ -90,3 +91,13 @@ class Account(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import deleteAccountFromProject
|
||||
|
||||
class AccountFromProject(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def delete(self, apiclient, projectid, account, **kwargs):
|
||||
cmd = deleteAccountFromProject.deleteAccountFromProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.account = account
|
||||
cmd.projectid = projectid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
accountfromproject = apiclient.deleteAccountFromProject(cmd)
|
||||
return accountfromproject
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addAccountToProject
|
||||
|
||||
class AccountToProject(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(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
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listAutoScalePolicies
|
||||
|
||||
class AutoScalePolicies(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@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: AutoScalePolicies(e.__dict__), autoscalepolicies)
|
||||
|
|
@ -18,6 +18,7 @@ from marvin.integration.lib.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):
|
||||
|
||||
|
|
@ -51,3 +52,10 @@ class AutoScalePolicy(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import ldapConfig
|
||||
|
||||
class Config(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def ldap(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
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import updateDefaultNicForVirtualMachine
|
||||
|
||||
class DefaultNicForVirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def update(self, apiclient, nicid, virtualmachineid, **kwargs):
|
||||
cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.nicid = nicid
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
defaultnicforvirtualmachine = apiclient.updateDefaultNicForVirtualMachine(cmd)
|
||||
return defaultnicforvirtualmachine
|
||||
|
|
@ -1,35 +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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import markDefaultZoneForAccount
|
||||
|
||||
class DefaultZoneForAccount(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def mark(self, apiclient, account, domainid, zoneid, **kwargs):
|
||||
cmd = markDefaultZoneForAccount.markDefaultZoneForAccountCmd()
|
||||
cmd.id = self.id
|
||||
cmd.account = account
|
||||
cmd.domainid = domainid
|
||||
cmd.zoneid = zoneid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
defaultzoneforaccount = apiclient.markDefaultZoneForAccount(cmd)
|
||||
return defaultzoneforaccount
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import removeFromGlobalLoadBalancerRule
|
||||
|
||||
class FromGlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def remove(self, apiclient, loadbalancerrulelist, id, **kwargs):
|
||||
cmd = removeFromGlobalLoadBalancerRule.removeFromGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
cmd.loadbalancerrulelist = loadbalancerrulelist
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
fromgloballoadbalancerrule = apiclient.removeFromGlobalLoadBalancerRule(cmd)
|
||||
return fromgloballoadbalancerrule
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import removeFromLoadBalancerRule
|
||||
|
||||
class FromLoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def remove(self, apiclient, id, virtualmachineids, **kwargs):
|
||||
cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
cmd.virtualmachineids = virtualmachineids
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
fromloadbalancerrule = apiclient.removeFromLoadBalancerRule(cmd)
|
||||
return fromloadbalancerrule
|
||||
|
|
@ -19,6 +19,8 @@ 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):
|
||||
|
||||
|
|
@ -44,19 +46,35 @@ class GlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: GlobalLoadBalancerRule(e.__dict__), globalloadbalancerrule)
|
||||
|
||||
|
||||
def update(self, apiclient, id, **kwargs):
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateGlobalLoadBalancerRule.updateGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
globalloadbalancerrule = apiclient.updateGlobalLoadBalancerRule(cmd)
|
||||
return globalloadbalancerrule
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteGlobalLoadBalancerRule.deleteGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = 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
|
||||
|
|
@ -20,6 +20,9 @@ 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):
|
||||
|
||||
|
|
@ -75,3 +78,29 @@ class Host(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import prepareHostForMaintenance
|
||||
|
||||
class HostForMaintenance(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def prepare(self, apiclient, id, **kwargs):
|
||||
cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hostformaintenance = apiclient.prepareHostForMaintenance(cmd)
|
||||
return hostformaintenance
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import cancelHostMaintenance
|
||||
|
||||
class HostMaintenance(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def cancel(self, apiclient, id, **kwargs):
|
||||
cmd = cancelHostMaintenance.cancelHostMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
hostmaintenance = apiclient.cancelHostMaintenance(cmd)
|
||||
return hostmaintenance
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import updateHostPassword
|
||||
|
||||
class HostPassword(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def update(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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import removeIpFromNic
|
||||
|
||||
class IpFromNic(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def remove(self, apiclient, id, **kwargs):
|
||||
cmd = removeIpFromNic.removeIpFromNicCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
ipfromnic = apiclient.removeIpFromNic(cmd)
|
||||
return ipfromnic
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addIpToNic
|
||||
|
||||
class IpToNic(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, nicid, **kwargs):
|
||||
cmd = addIpToNic.addIpToNicCmd()
|
||||
cmd.id = self.id
|
||||
cmd.nicid = nicid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
iptonic = apiclient.addIpToNic(cmd)
|
||||
return iptonic
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listLBHealthCheckPolicies
|
||||
|
||||
class LBHealthCheckPolicies(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@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: LBHealthCheckPolicies(e.__dict__), lbhealthcheckpolicies)
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
from marvin.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createLBHealthCheckPolicy
|
||||
from marvin.cloudstackAPI import deleteLBHealthCheckPolicy
|
||||
from marvin.cloudstackAPI import listLBHealthCheckPolicies
|
||||
|
||||
class LBHealthCheckPolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
|
@ -41,3 +42,12 @@ class LBHealthCheckPolicy(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listLBStickinessPolicies
|
||||
|
||||
class LBStickinessPolicies(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@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: LBStickinessPolicies(e.__dict__), lbstickinesspolicies)
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
from marvin.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createLBStickinessPolicy
|
||||
from marvin.cloudstackAPI import deleteLBStickinessPolicy
|
||||
from marvin.cloudstackAPI import listLBStickinessPolicies
|
||||
|
||||
class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
|
@ -41,3 +42,12 @@ class LBStickinessPolicy(CloudStackEntity.CloudStackEntity):
|
|||
[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)
|
||||
|
|
|
|||
|
|
@ -16,15 +16,24 @@
|
|||
# under the License.
|
||||
from marvin.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import ldapRemove
|
||||
from marvin.cloudstackAPI import ldapConfig
|
||||
|
||||
class Remove(CloudStackEntity.CloudStackEntity):
|
||||
class Ldap(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def ldap(self, apiclient, **kwargs):
|
||||
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()]
|
||||
|
|
@ -19,6 +19,9 @@ 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):
|
||||
|
||||
|
|
@ -44,19 +47,44 @@ class LoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: LoadBalancerRule(e.__dict__), loadbalancerrule)
|
||||
|
||||
|
||||
def update(self, apiclient, id, **kwargs):
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerrule = apiclient.updateLoadBalancerRule(cmd)
|
||||
return loadbalancerrule
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = 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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listLoadBalancerRuleInstances
|
||||
|
||||
class LoadBalancerRuleInstances(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(self, apiclient, id, **kwargs):
|
||||
cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd()
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
loadbalancerruleinstances = apiclient.listLoadBalancerRuleInstances(cmd)
|
||||
return map(lambda e: LoadBalancerRuleInstances(e.__dict__), loadbalancerruleinstances)
|
||||
|
|
@ -16,8 +16,10 @@
|
|||
# under the License.
|
||||
from marvin.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listNics
|
||||
from marvin.cloudstackAPI import addIpToNic
|
||||
from marvin.cloudstackAPI import removeIpFromNic
|
||||
|
||||
class Nics(CloudStackEntity.CloudStackEntity):
|
||||
class Nic(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
|
|
@ -30,4 +32,20 @@ class Nics(CloudStackEntity.CloudStackEntity):
|
|||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
nics = apiclient.listNics(cmd)
|
||||
return map(lambda e: Nics(e.__dict__), nics)
|
||||
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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import removeNicFromVirtualMachine
|
||||
|
||||
class NicFromVirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def remove(self, apiclient, nicid, virtualmachineid, **kwargs):
|
||||
cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.nicid = nicid
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
nicfromvirtualmachine = apiclient.removeNicFromVirtualMachine(cmd)
|
||||
return nicfromvirtualmachine
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import addNicToVirtualMachine
|
||||
|
||||
class NicToVirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def add(self, apiclient, networkid, virtualmachineid, **kwargs):
|
||||
cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.networkid = networkid
|
||||
cmd.virtualmachineid = virtualmachineid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
nictovirtualmachine = apiclient.addNicToVirtualMachine(cmd)
|
||||
return nictovirtualmachine
|
||||
|
|
@ -18,6 +18,7 @@ from marvin.integration.lib.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):
|
||||
|
||||
|
|
@ -54,3 +55,11 @@ class NiciraNvpDevice(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listNiciraNvpDeviceNetworks
|
||||
|
||||
class NiciraNvpDeviceNetworks(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(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: NiciraNvpDeviceNetworks(e.__dict__), niciranvpdevicenetworks)
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import resetPasswordForVirtualMachine
|
||||
|
||||
class PasswordForVirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def reset(self, apiclient, id, **kwargs):
|
||||
cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
passwordforvirtualmachine = apiclient.resetPasswordForVirtualMachine(cmd)
|
||||
return passwordforvirtualmachine
|
||||
|
|
@ -44,19 +44,17 @@ class PhysicalNetwork(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: PhysicalNetwork(e.__dict__), physicalnetwork)
|
||||
|
||||
|
||||
def update(self, apiclient, id, **kwargs):
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
physicalnetwork = apiclient.updatePhysicalNetwork(cmd)
|
||||
return physicalnetwork
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
physicalnetwork = apiclient.deletePhysicalNetwork(cmd)
|
||||
return physicalnetwork
|
||||
|
|
|
|||
|
|
@ -44,19 +44,17 @@ class Pod(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: Pod(e.__dict__), pod)
|
||||
|
||||
|
||||
def update(self, apiclient, id, **kwargs):
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updatePod.updatePodCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
pod = apiclient.updatePod(cmd)
|
||||
return pod
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePod.deletePodCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
pod = apiclient.deletePod(cmd)
|
||||
return pod
|
||||
|
|
|
|||
|
|
@ -56,10 +56,9 @@ class PortForwardingRule(CloudStackEntity.CloudStackEntity):
|
|||
return portforwardingrule
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePortForwardingRule.deletePortForwardingRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
portforwardingrule = apiclient.deletePortForwardingRule(cmd)
|
||||
return portforwardingrule
|
||||
|
|
|
|||
|
|
@ -43,10 +43,9 @@ class PrivateGateway(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: PrivateGateway(e.__dict__), privategateway)
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deletePrivateGateway.deletePrivateGatewayCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
privategateway = apiclient.deletePrivateGateway(cmd)
|
||||
return privategateway
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ 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):
|
||||
|
||||
|
|
@ -29,10 +32,9 @@ class Project(CloudStackEntity.CloudStackEntity):
|
|||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def suspend(self, apiclient, id, **kwargs):
|
||||
def suspend(self, apiclient, **kwargs):
|
||||
cmd = suspendProject.suspendProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.suspendProject(cmd)
|
||||
return project
|
||||
|
|
@ -55,28 +57,51 @@ class Project(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: Project(e.__dict__), project)
|
||||
|
||||
|
||||
def update(self, apiclient, id, **kwargs):
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateProject.updateProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.updateProject(cmd)
|
||||
return project
|
||||
|
||||
|
||||
def activate(self, apiclient, id, **kwargs):
|
||||
def activate(self, apiclient, **kwargs):
|
||||
cmd = activateProject.activateProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
project = apiclient.activateProject(cmd)
|
||||
return project
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteProject.deleteProjectCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = 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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listProjectAccounts
|
||||
|
||||
class ProjectAccounts(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@classmethod
|
||||
def list(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: ProjectAccounts(e.__dict__), projectaccounts)
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import resetSSHKeyForVirtualMachine
|
||||
|
||||
class SSHKeyForVirtualMachine(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def reset(self, apiclient, keypair, id, **kwargs):
|
||||
cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
cmd.keypair = keypair
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
sshkeyforvirtualmachine = apiclient.resetSSHKeyForVirtualMachine(cmd)
|
||||
return sshkeyforvirtualmachine
|
||||
|
|
@ -18,6 +18,10 @@ from marvin.integration.lib.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):
|
||||
|
||||
|
|
@ -49,3 +53,29 @@ class SecurityGroup(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import authorizeSecurityGroupEgress
|
||||
from marvin.cloudstackAPI import revokeSecurityGroupEgress
|
||||
|
||||
class SecurityGroupEgress(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def authorize(self, apiclient, **kwargs):
|
||||
cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroupegress = apiclient.authorizeSecurityGroupEgress(cmd)
|
||||
return securitygroupegress
|
||||
|
||||
|
||||
def revoke(self, apiclient, id, **kwargs):
|
||||
cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroupegress = apiclient.revokeSecurityGroupEgress(cmd)
|
||||
return securitygroupegress
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import authorizeSecurityGroupIngress
|
||||
from marvin.cloudstackAPI import revokeSecurityGroupIngress
|
||||
|
||||
class SecurityGroupIngress(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def authorize(self, apiclient, **kwargs):
|
||||
cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd()
|
||||
cmd.id = self.id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroupingress = apiclient.authorizeSecurityGroupIngress(cmd)
|
||||
return securitygroupingress
|
||||
|
||||
|
||||
def revoke(self, apiclient, id, **kwargs):
|
||||
cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
securitygroupingress = apiclient.revokeSecurityGroupIngress(cmd)
|
||||
return securitygroupingress
|
||||
|
|
@ -43,10 +43,9 @@ class Snapshot(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: Snapshot(e.__dict__), snapshot)
|
||||
|
||||
|
||||
def delete(self, apiclient, id, **kwargs):
|
||||
def delete(self, apiclient, **kwargs):
|
||||
cmd = deleteSnapshot.deleteSnapshotCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
snapshot = apiclient.deleteSnapshot(cmd)
|
||||
return snapshot
|
||||
|
|
|
|||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import listSnapshotPolicies
|
||||
from marvin.cloudstackAPI import deleteSnapshotPolicies
|
||||
|
||||
class SnapshotPolicies(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
@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: SnapshotPolicies(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
|
||||
|
|
@ -16,6 +16,8 @@
|
|||
# under the License.
|
||||
from marvin.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import createSnapshotPolicy
|
||||
from marvin.cloudstackAPI import listSnapshotPolicies
|
||||
from marvin.cloudstackAPI import deleteSnapshotPolicies
|
||||
|
||||
class SnapshotPolicy(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
|
@ -31,3 +33,20 @@ class SnapshotPolicy(CloudStackEntity.CloudStackEntity):
|
|||
[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,43 +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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import cancelStorageMaintenance
|
||||
from marvin.cloudstackAPI import enableStorageMaintenance
|
||||
|
||||
class StorageMaintenance(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def cancel(self, apiclient, id, **kwargs):
|
||||
cmd = cancelStorageMaintenance.cancelStorageMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagemaintenance = apiclient.cancelStorageMaintenance(cmd)
|
||||
return storagemaintenance
|
||||
|
||||
|
||||
def enable(self, apiclient, id, **kwargs):
|
||||
cmd = enableStorageMaintenance.enableStorageMaintenanceCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
storagemaintenance = apiclient.enableStorageMaintenance(cmd)
|
||||
return storagemaintenance
|
||||
|
|
@ -19,6 +19,8 @@ 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):
|
||||
|
||||
|
|
@ -60,3 +62,19 @@ class StoragePool(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import assignToGlobalLoadBalancerRule
|
||||
|
||||
class ToGlobalLoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def assign(self, apiclient, loadbalancerrulelist, id, **kwargs):
|
||||
cmd = assignToGlobalLoadBalancerRule.assignToGlobalLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
cmd.loadbalancerrulelist = loadbalancerrulelist
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
togloballoadbalancerrule = apiclient.assignToGlobalLoadBalancerRule(cmd)
|
||||
return togloballoadbalancerrule
|
||||
|
|
@ -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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import assignToLoadBalancerRule
|
||||
|
||||
class ToLoadBalancerRule(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def assign(self, apiclient, id, virtualmachineids, **kwargs):
|
||||
cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
cmd.virtualmachineids = virtualmachineids
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
toloadbalancerrule = apiclient.assignToLoadBalancerRule(cmd)
|
||||
return toloadbalancerrule
|
||||
|
|
@ -23,6 +23,7 @@ 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):
|
||||
|
||||
|
|
@ -100,3 +101,11 @@ class User(CloudStackEntity.CloudStackEntity):
|
|||
[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,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.integration.lib.base import CloudStackEntity
|
||||
from marvin.cloudstackAPI import registerUserKeys
|
||||
|
||||
class UserKeys(CloudStackEntity.CloudStackEntity):
|
||||
|
||||
|
||||
def __init__(self, items):
|
||||
self.__dict__.update(items)
|
||||
|
||||
|
||||
def register(self, apiclient, id, **kwargs):
|
||||
cmd = registerUserKeys.registerUserKeysCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
userkeys = apiclient.registerUserKeys(cmd)
|
||||
return userkeys
|
||||
|
|
@ -26,6 +26,11 @@ 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):
|
||||
|
||||
|
|
@ -43,10 +48,9 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
|
|||
return virtualmachine
|
||||
|
||||
|
||||
def scale(self, apiclient, id, serviceofferingid, **kwargs):
|
||||
def scale(self, apiclient, serviceofferingid, **kwargs):
|
||||
cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
cmd.serviceofferingid = serviceofferingid
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.scaleVirtualMachine(cmd)
|
||||
|
|
@ -79,46 +83,41 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
|
|||
return map(lambda e: VirtualMachine(e.__dict__), virtualmachine)
|
||||
|
||||
|
||||
def stop(self, apiclient, id, **kwargs):
|
||||
def stop(self, apiclient, **kwargs):
|
||||
cmd = stopVirtualMachine.stopVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.stopVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def reboot(self, apiclient, id, **kwargs):
|
||||
def reboot(self, apiclient, **kwargs):
|
||||
cmd = rebootVirtualMachine.rebootVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.rebootVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def update(self, apiclient, id, **kwargs):
|
||||
def update(self, apiclient, **kwargs):
|
||||
cmd = updateVirtualMachine.updateVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.updateVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def start(self, apiclient, id, **kwargs):
|
||||
def start(self, apiclient, **kwargs):
|
||||
cmd = startVirtualMachine.startVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.startVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
||||
|
||||
def destroy(self, apiclient, id, **kwargs):
|
||||
def destroy(self, apiclient, **kwargs):
|
||||
cmd = destroyVirtualMachine.destroyVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.id = id
|
||||
[setattr(cmd, key, value) for key,value in kwargs.iteritems()]
|
||||
virtualmachine = apiclient.destroyVirtualMachine(cmd)
|
||||
return virtualmachine
|
||||
|
|
@ -133,3 +132,46 @@ class VirtualMachine(CloudStackEntity.CloudStackEntity):
|
|||
[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
|
||||
|
|
|
|||
Loading…
Reference in New Issue