diff --git a/tools/marvin/marvin/base/Account.py b/tools/marvin/marvin/base/Account.py deleted file mode 100644 index 32744c93cf5..00000000000 --- a/tools/marvin/marvin/base/Account.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Alerts.py b/tools/marvin/marvin/base/Alerts.py deleted file mode 100644 index 34aae97dfdd..00000000000 --- a/tools/marvin/marvin/base/Alerts.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/ApiLimit.py b/tools/marvin/marvin/base/ApiLimit.py deleted file mode 100644 index 34885b6e753..00000000000 --- a/tools/marvin/marvin/base/ApiLimit.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Apis.py b/tools/marvin/marvin/base/Apis.py deleted file mode 100644 index 0b56a5039cc..00000000000 --- a/tools/marvin/marvin/base/Apis.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/AsyncJobResult.py b/tools/marvin/marvin/base/AsyncJobResult.py deleted file mode 100644 index 70a89cb6668..00000000000 --- a/tools/marvin/marvin/base/AsyncJobResult.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/AsyncJobs.py b/tools/marvin/marvin/base/AsyncJobs.py deleted file mode 100644 index db39c4abc0c..00000000000 --- a/tools/marvin/marvin/base/AsyncJobs.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/AutoScalePolicy.py b/tools/marvin/marvin/base/AutoScalePolicy.py deleted file mode 100644 index 03d073f3b87..00000000000 --- a/tools/marvin/marvin/base/AutoScalePolicy.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/AutoScaleVmGroup.py b/tools/marvin/marvin/base/AutoScaleVmGroup.py deleted file mode 100644 index 99fbd8c594d..00000000000 --- a/tools/marvin/marvin/base/AutoScaleVmGroup.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/AutoScaleVmProfile.py b/tools/marvin/marvin/base/AutoScaleVmProfile.py deleted file mode 100644 index e631f76f2ee..00000000000 --- a/tools/marvin/marvin/base/AutoScaleVmProfile.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/BigSwitchVnsDevice.py b/tools/marvin/marvin/base/BigSwitchVnsDevice.py deleted file mode 100644 index 0f544d42265..00000000000 --- a/tools/marvin/marvin/base/BigSwitchVnsDevice.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Capabilities.py b/tools/marvin/marvin/base/Capabilities.py deleted file mode 100644 index 6cd4fd95401..00000000000 --- a/tools/marvin/marvin/base/Capabilities.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/Capacity.py b/tools/marvin/marvin/base/Capacity.py deleted file mode 100644 index ae65468ad75..00000000000 --- a/tools/marvin/marvin/base/Capacity.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/CloudIdentifier.py b/tools/marvin/marvin/base/CloudIdentifier.py deleted file mode 100644 index 4f055f9578f..00000000000 --- a/tools/marvin/marvin/base/CloudIdentifier.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Cluster.py b/tools/marvin/marvin/base/Cluster.py deleted file mode 100644 index 80ac7eee4f1..00000000000 --- a/tools/marvin/marvin/base/Cluster.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Condition.py b/tools/marvin/marvin/base/Condition.py deleted file mode 100644 index e20c2ef08b6..00000000000 --- a/tools/marvin/marvin/base/Condition.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Configuration.py b/tools/marvin/marvin/base/Configuration.py deleted file mode 100644 index caf63ea1cb2..00000000000 --- a/tools/marvin/marvin/base/Configuration.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Counter.py b/tools/marvin/marvin/base/Counter.py deleted file mode 100644 index ca0e9aaf0ca..00000000000 --- a/tools/marvin/marvin/base/Counter.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/CustomCertificate.py b/tools/marvin/marvin/base/CustomCertificate.py deleted file mode 100644 index 6df35161c16..00000000000 --- a/tools/marvin/marvin/base/CustomCertificate.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/DiskOffering.py b/tools/marvin/marvin/base/DiskOffering.py deleted file mode 100644 index bdab728bbf0..00000000000 --- a/tools/marvin/marvin/base/DiskOffering.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Domain.py b/tools/marvin/marvin/base/Domain.py deleted file mode 100644 index 9fd87d2fc09..00000000000 --- a/tools/marvin/marvin/base/Domain.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/DomainChildren.py b/tools/marvin/marvin/base/DomainChildren.py deleted file mode 100644 index 860348d0211..00000000000 --- a/tools/marvin/marvin/base/DomainChildren.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/EgressFirewallRule.py b/tools/marvin/marvin/base/EgressFirewallRule.py deleted file mode 100644 index fb14a39b947..00000000000 --- a/tools/marvin/marvin/base/EgressFirewallRule.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/EventTypes.py b/tools/marvin/marvin/base/EventTypes.py deleted file mode 100644 index 5b6ce099894..00000000000 --- a/tools/marvin/marvin/base/EventTypes.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/Events.py b/tools/marvin/marvin/base/Events.py deleted file mode 100644 index ba39f5425e3..00000000000 --- a/tools/marvin/marvin/base/Events.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/FirewallRule.py b/tools/marvin/marvin/base/FirewallRule.py deleted file mode 100644 index f54c3714997..00000000000 --- a/tools/marvin/marvin/base/FirewallRule.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/GlobalLoadBalancerRule.py b/tools/marvin/marvin/base/GlobalLoadBalancerRule.py deleted file mode 100644 index 0ade923318f..00000000000 --- a/tools/marvin/marvin/base/GlobalLoadBalancerRule.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Host.py b/tools/marvin/marvin/base/Host.py deleted file mode 100644 index 9127a22de84..00000000000 --- a/tools/marvin/marvin/base/Host.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/HypervisorCapabilities.py b/tools/marvin/marvin/base/HypervisorCapabilities.py deleted file mode 100644 index 879ff70915e..00000000000 --- a/tools/marvin/marvin/base/HypervisorCapabilities.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Hypervisors.py b/tools/marvin/marvin/base/Hypervisors.py deleted file mode 100644 index ba9a89e4574..00000000000 --- a/tools/marvin/marvin/base/Hypervisors.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/InstanceGroup.py b/tools/marvin/marvin/base/InstanceGroup.py deleted file mode 100644 index 64019f85681..00000000000 --- a/tools/marvin/marvin/base/InstanceGroup.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/IpAddress.py b/tools/marvin/marvin/base/IpAddress.py deleted file mode 100644 index 43d82a16a60..00000000000 --- a/tools/marvin/marvin/base/IpAddress.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/IpForwardingRule.py b/tools/marvin/marvin/base/IpForwardingRule.py deleted file mode 100644 index 479e5b38d8a..00000000000 --- a/tools/marvin/marvin/base/IpForwardingRule.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Iso.py b/tools/marvin/marvin/base/Iso.py deleted file mode 100644 index 52070e243bb..00000000000 --- a/tools/marvin/marvin/base/Iso.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/IsoPermissions.py b/tools/marvin/marvin/base/IsoPermissions.py deleted file mode 100644 index 8893cecb001..00000000000 --- a/tools/marvin/marvin/base/IsoPermissions.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/LBHealthCheckPolicy.py b/tools/marvin/marvin/base/LBHealthCheckPolicy.py deleted file mode 100644 index 61843700d91..00000000000 --- a/tools/marvin/marvin/base/LBHealthCheckPolicy.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/LBStickinessPolicy.py b/tools/marvin/marvin/base/LBStickinessPolicy.py deleted file mode 100644 index 9d251196c3b..00000000000 --- a/tools/marvin/marvin/base/LBStickinessPolicy.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/Ldap.py b/tools/marvin/marvin/base/Ldap.py deleted file mode 100644 index 19de47d03d4..00000000000 --- a/tools/marvin/marvin/base/Ldap.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/LoadBalancerRule.py b/tools/marvin/marvin/base/LoadBalancerRule.py deleted file mode 100644 index 3d9f999493c..00000000000 --- a/tools/marvin/marvin/base/LoadBalancerRule.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/Network.py b/tools/marvin/marvin/base/Network.py deleted file mode 100644 index 46232dc3bb9..00000000000 --- a/tools/marvin/marvin/base/Network.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/NetworkACL.py b/tools/marvin/marvin/base/NetworkACL.py deleted file mode 100644 index 7c81cd182cc..00000000000 --- a/tools/marvin/marvin/base/NetworkACL.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/NetworkDevice.py b/tools/marvin/marvin/base/NetworkDevice.py deleted file mode 100644 index 61c249ddb1e..00000000000 --- a/tools/marvin/marvin/base/NetworkDevice.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/NetworkOffering.py b/tools/marvin/marvin/base/NetworkOffering.py deleted file mode 100644 index 30fb37244de..00000000000 --- a/tools/marvin/marvin/base/NetworkOffering.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/NetworkServiceProvider.py b/tools/marvin/marvin/base/NetworkServiceProvider.py deleted file mode 100644 index 39e9a422c88..00000000000 --- a/tools/marvin/marvin/base/NetworkServiceProvider.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Nic.py b/tools/marvin/marvin/base/Nic.py deleted file mode 100644 index d1dcaa531c1..00000000000 --- a/tools/marvin/marvin/base/Nic.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/NiciraNvpDevice.py b/tools/marvin/marvin/base/NiciraNvpDevice.py deleted file mode 100644 index 11eaa53bd09..00000000000 --- a/tools/marvin/marvin/base/NiciraNvpDevice.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/OsCategories.py b/tools/marvin/marvin/base/OsCategories.py deleted file mode 100644 index 53799f541ad..00000000000 --- a/tools/marvin/marvin/base/OsCategories.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/OsTypes.py b/tools/marvin/marvin/base/OsTypes.py deleted file mode 100644 index 269bce7fbed..00000000000 --- a/tools/marvin/marvin/base/OsTypes.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/PhysicalNetwork.py b/tools/marvin/marvin/base/PhysicalNetwork.py deleted file mode 100644 index d802fd11fbf..00000000000 --- a/tools/marvin/marvin/base/PhysicalNetwork.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Pod.py b/tools/marvin/marvin/base/Pod.py deleted file mode 100644 index 17935bd53c9..00000000000 --- a/tools/marvin/marvin/base/Pod.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/PortForwardingRule.py b/tools/marvin/marvin/base/PortForwardingRule.py deleted file mode 100644 index 42448fdefe5..00000000000 --- a/tools/marvin/marvin/base/PortForwardingRule.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/PrivateGateway.py b/tools/marvin/marvin/base/PrivateGateway.py deleted file mode 100644 index d4d58d3a3dc..00000000000 --- a/tools/marvin/marvin/base/PrivateGateway.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Project.py b/tools/marvin/marvin/base/Project.py deleted file mode 100644 index 9c13ece6464..00000000000 --- a/tools/marvin/marvin/base/Project.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/ProjectInvitation.py b/tools/marvin/marvin/base/ProjectInvitation.py deleted file mode 100644 index 7eddce758e2..00000000000 --- a/tools/marvin/marvin/base/ProjectInvitation.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Region.py b/tools/marvin/marvin/base/Region.py deleted file mode 100644 index e5201963410..00000000000 --- a/tools/marvin/marvin/base/Region.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/RemoteAccessVpn.py b/tools/marvin/marvin/base/RemoteAccessVpn.py deleted file mode 100644 index 5a0bc9a3960..00000000000 --- a/tools/marvin/marvin/base/RemoteAccessVpn.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/ResourceCount.py b/tools/marvin/marvin/base/ResourceCount.py deleted file mode 100644 index 06a1dce0ae4..00000000000 --- a/tools/marvin/marvin/base/ResourceCount.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/ResourceLimit.py b/tools/marvin/marvin/base/ResourceLimit.py deleted file mode 100644 index 78c9c910d03..00000000000 --- a/tools/marvin/marvin/base/ResourceLimit.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Router.py b/tools/marvin/marvin/base/Router.py deleted file mode 100644 index 012eb33d52c..00000000000 --- a/tools/marvin/marvin/base/Router.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/S3.py b/tools/marvin/marvin/base/S3.py deleted file mode 100644 index d9957945c48..00000000000 --- a/tools/marvin/marvin/base/S3.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/SSHKeyPair.py b/tools/marvin/marvin/base/SSHKeyPair.py deleted file mode 100644 index 670515686ac..00000000000 --- a/tools/marvin/marvin/base/SSHKeyPair.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/SecondaryStorage.py b/tools/marvin/marvin/base/SecondaryStorage.py deleted file mode 100644 index ec57bb13d1f..00000000000 --- a/tools/marvin/marvin/base/SecondaryStorage.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/SecurityGroup.py b/tools/marvin/marvin/base/SecurityGroup.py deleted file mode 100644 index 3ed662c90f3..00000000000 --- a/tools/marvin/marvin/base/SecurityGroup.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/ServiceForRouter.py b/tools/marvin/marvin/base/ServiceForRouter.py deleted file mode 100644 index c2e8f3521da..00000000000 --- a/tools/marvin/marvin/base/ServiceForRouter.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/ServiceForSystemVm.py b/tools/marvin/marvin/base/ServiceForSystemVm.py deleted file mode 100644 index 512154f62eb..00000000000 --- a/tools/marvin/marvin/base/ServiceForSystemVm.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/ServiceForVirtualMachine.py b/tools/marvin/marvin/base/ServiceForVirtualMachine.py deleted file mode 100644 index a8fbff00699..00000000000 --- a/tools/marvin/marvin/base/ServiceForVirtualMachine.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/ServiceOffering.py b/tools/marvin/marvin/base/ServiceOffering.py deleted file mode 100644 index aa49bb34e3c..00000000000 --- a/tools/marvin/marvin/base/ServiceOffering.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Simulator.py b/tools/marvin/marvin/base/Simulator.py deleted file mode 100644 index e609f48f403..00000000000 --- a/tools/marvin/marvin/base/Simulator.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Snapshot.py b/tools/marvin/marvin/base/Snapshot.py deleted file mode 100644 index d8f990f1e86..00000000000 --- a/tools/marvin/marvin/base/Snapshot.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/SnapshotPolicy.py b/tools/marvin/marvin/base/SnapshotPolicy.py deleted file mode 100644 index 5358bac917f..00000000000 --- a/tools/marvin/marvin/base/SnapshotPolicy.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/StaticNat.py b/tools/marvin/marvin/base/StaticNat.py deleted file mode 100644 index e99256793fd..00000000000 --- a/tools/marvin/marvin/base/StaticNat.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/StaticRoute.py b/tools/marvin/marvin/base/StaticRoute.py deleted file mode 100644 index e8bf1878388..00000000000 --- a/tools/marvin/marvin/base/StaticRoute.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/StorageNetworkIpRange.py b/tools/marvin/marvin/base/StorageNetworkIpRange.py deleted file mode 100644 index 350529c6823..00000000000 --- a/tools/marvin/marvin/base/StorageNetworkIpRange.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/StoragePool.py b/tools/marvin/marvin/base/StoragePool.py deleted file mode 100644 index 26f039e0cb2..00000000000 --- a/tools/marvin/marvin/base/StoragePool.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/StorageProviders.py b/tools/marvin/marvin/base/StorageProviders.py deleted file mode 100644 index 7dab8a67977..00000000000 --- a/tools/marvin/marvin/base/StorageProviders.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/SupportedNetworkServices.py b/tools/marvin/marvin/base/SupportedNetworkServices.py deleted file mode 100644 index ec62c06f420..00000000000 --- a/tools/marvin/marvin/base/SupportedNetworkServices.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/Swift.py b/tools/marvin/marvin/base/Swift.py deleted file mode 100644 index 3cef301e69b..00000000000 --- a/tools/marvin/marvin/base/Swift.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/SystemVm.py b/tools/marvin/marvin/base/SystemVm.py deleted file mode 100644 index 45e7a7541d0..00000000000 --- a/tools/marvin/marvin/base/SystemVm.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Tags.py b/tools/marvin/marvin/base/Tags.py deleted file mode 100644 index 38e47a5db60..00000000000 --- a/tools/marvin/marvin/base/Tags.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Template.py b/tools/marvin/marvin/base/Template.py deleted file mode 100644 index b2c6fada939..00000000000 --- a/tools/marvin/marvin/base/Template.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/TemplatePermissions.py b/tools/marvin/marvin/base/TemplatePermissions.py deleted file mode 100644 index 2f3e31a7438..00000000000 --- a/tools/marvin/marvin/base/TemplatePermissions.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/TrafficMonitor.py b/tools/marvin/marvin/base/TrafficMonitor.py deleted file mode 100644 index 4625a5628c8..00000000000 --- a/tools/marvin/marvin/base/TrafficMonitor.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/TrafficType.py b/tools/marvin/marvin/base/TrafficType.py deleted file mode 100644 index 1d9fed11d5c..00000000000 --- a/tools/marvin/marvin/base/TrafficType.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/TrafficTypeImplementors.py b/tools/marvin/marvin/base/TrafficTypeImplementors.py deleted file mode 100644 index 39f31120e79..00000000000 --- a/tools/marvin/marvin/base/TrafficTypeImplementors.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/UsageRecords.py b/tools/marvin/marvin/base/UsageRecords.py deleted file mode 100644 index 1349a18b860..00000000000 --- a/tools/marvin/marvin/base/UsageRecords.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/UsageTypes.py b/tools/marvin/marvin/base/UsageTypes.py deleted file mode 100644 index 46d4e5dcc66..00000000000 --- a/tools/marvin/marvin/base/UsageTypes.py +++ /dev/null @@ -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) diff --git a/tools/marvin/marvin/base/User.py b/tools/marvin/marvin/base/User.py deleted file mode 100644 index 5d094e4a704..00000000000 --- a/tools/marvin/marvin/base/User.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VMPassword.py b/tools/marvin/marvin/base/VMPassword.py deleted file mode 100644 index 87d7c8e34cd..00000000000 --- a/tools/marvin/marvin/base/VMPassword.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VMSnapshot.py b/tools/marvin/marvin/base/VMSnapshot.py deleted file mode 100644 index f88b57776a3..00000000000 --- a/tools/marvin/marvin/base/VMSnapshot.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VPC.py b/tools/marvin/marvin/base/VPC.py deleted file mode 100644 index 51e76f0ccc5..00000000000 --- a/tools/marvin/marvin/base/VPC.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VPCOffering.py b/tools/marvin/marvin/base/VPCOffering.py deleted file mode 100644 index 3028fdde670..00000000000 --- a/tools/marvin/marvin/base/VPCOffering.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VirtualMachine.py b/tools/marvin/marvin/base/VirtualMachine.py deleted file mode 100644 index d6dfd6d0468..00000000000 --- a/tools/marvin/marvin/base/VirtualMachine.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VirtualRouterElement.py b/tools/marvin/marvin/base/VirtualRouterElement.py deleted file mode 100644 index 14c227961fb..00000000000 --- a/tools/marvin/marvin/base/VirtualRouterElement.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VlanIpRange.py b/tools/marvin/marvin/base/VlanIpRange.py deleted file mode 100644 index a3a4746e9e7..00000000000 --- a/tools/marvin/marvin/base/VlanIpRange.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Volume.py b/tools/marvin/marvin/base/Volume.py deleted file mode 100644 index 169f4f05cce..00000000000 --- a/tools/marvin/marvin/base/Volume.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VpnConnection.py b/tools/marvin/marvin/base/VpnConnection.py deleted file mode 100644 index 9dd65124d3a..00000000000 --- a/tools/marvin/marvin/base/VpnConnection.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VpnCustomerGateway.py b/tools/marvin/marvin/base/VpnCustomerGateway.py deleted file mode 100644 index 76af3dc15e7..00000000000 --- a/tools/marvin/marvin/base/VpnCustomerGateway.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VpnGateway.py b/tools/marvin/marvin/base/VpnGateway.py deleted file mode 100644 index 541a3fff7eb..00000000000 --- a/tools/marvin/marvin/base/VpnGateway.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/VpnUser.py b/tools/marvin/marvin/base/VpnUser.py deleted file mode 100644 index e940aca2164..00000000000 --- a/tools/marvin/marvin/base/VpnUser.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/base/Zone.py b/tools/marvin/marvin/base/Zone.py deleted file mode 100644 index aba9f566a86..00000000000 --- a/tools/marvin/marvin/base/Zone.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/factory/AccountFactory.py b/tools/marvin/marvin/factory/AccountFactory.py deleted file mode 100644 index db38732553e..00000000000 --- a/tools/marvin/marvin/factory/AccountFactory.py +++ /dev/null @@ -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 diff --git a/tools/marvin/marvin/factory/AutoScalePolicyFactory.py b/tools/marvin/marvin/factory/AutoScalePolicyFactory.py deleted file mode 100644 index ad2640e5798..00000000000 --- a/tools/marvin/marvin/factory/AutoScalePolicyFactory.py +++ /dev/null @@ -1,26 +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.base import AutoScalePolicy - -class AutoScalePolicyFactory(factory.Factory): - - FACTORY_FOR = AutoScalePolicy - - action = None - conditionids = None - duration = None diff --git a/tools/marvin/marvin/factory/AutoScaleVmGroupFactory.py b/tools/marvin/marvin/factory/AutoScaleVmGroupFactory.py deleted file mode 100644 index 67562301210..00000000000 --- a/tools/marvin/marvin/factory/AutoScaleVmGroupFactory.py +++ /dev/null @@ -1,28 +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.base import AutoScaleVmGroup -class AutoScaleVmGroupFactory(factory.Factory): - - FACTORY_FOR = AutoScaleVmGroup - - lbruleid = None - maxmembers = None - minmembers = None - scaledownpolicyids = None - scaleuppolicyids = None - vmprofileid = None diff --git a/tools/marvin/marvin/factory/AutoScaleVmProfileFactory.py b/tools/marvin/marvin/factory/AutoScaleVmProfileFactory.py deleted file mode 100644 index 9e932b510d3..00000000000 --- a/tools/marvin/marvin/factory/AutoScaleVmProfileFactory.py +++ /dev/null @@ -1,25 +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.base import AutoScaleVmProfile -class AutoScaleVmProfileFactory(factory.Factory): - - FACTORY_FOR = AutoScaleVmProfile - - serviceofferingid = None - templateid = None - zoneid = None diff --git a/tools/marvin/marvin/factory/ClusterFactory.py b/tools/marvin/marvin/factory/ClusterFactory.py deleted file mode 100644 index d411bbb6b3a..00000000000 --- a/tools/marvin/marvin/factory/ClusterFactory.py +++ /dev/null @@ -1,24 +0,0 @@ -import factory -from marvin.base import Cluster -from marvin.factory import CloudStackBaseFactory -from marvin.utils import random_gen - -class ClusterFactory(CloudStackBaseFactory): - - FACTORY_FOR = Cluster - - clustername = None - clustertype = None - hypervisor = None - podid = None - zoneid = None - -class XenClusterFactory(ClusterFactory): - clustername = factory.Sequence(lambda n: "xencluster" + random_gen()) - clustertype = "XenServer" - hypervisor = "XenServer" - -class KvmClusterFactory(ClusterFactory): - clustername = factory.Sequence(lambda n: "kvmcluster" + random_gen()) - clustertype = "KVM" - hypervisor = "KVM" diff --git a/tools/marvin/marvin/factory/ConditionFactory.py b/tools/marvin/marvin/factory/ConditionFactory.py deleted file mode 100644 index 534fc75562b..00000000000 --- a/tools/marvin/marvin/factory/ConditionFactory.py +++ /dev/null @@ -1,26 +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.base import Condition - -class ConditionFactory(factory.Factory): - - FACTORY_FOR = Condition - - counterid = None - relationaloperator = None - threshold = None diff --git a/tools/marvin/marvin/factory/CounterFactory.py b/tools/marvin/marvin/factory/CounterFactory.py deleted file mode 100644 index 7dd16bb3519..00000000000 --- a/tools/marvin/marvin/factory/CounterFactory.py +++ /dev/null @@ -1,25 +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.base import Counter -class CounterFactory(factory.Factory): - - FACTORY_FOR = Counter - - name = None - source = None - value = None diff --git a/tools/marvin/marvin/factory/DiskOfferingFactory.py b/tools/marvin/marvin/factory/DiskOfferingFactory.py deleted file mode 100644 index dd14d744d9c..00000000000 --- a/tools/marvin/marvin/factory/DiskOfferingFactory.py +++ /dev/null @@ -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. -import factory -from marvin.factory.CloudStackBaseFactory import * -from marvin.base import DiskOffering -from marvin.utils import random_gen - -class DiskOfferingFactory(CloudStackBaseFactory): - - FACTORY_FOR = DiskOffering.DiskOffering - - displaytext = factory.Sequence(lambda n : "DiskOffering" + random_gen()) - name = factory.Sequence(lambda n : "DiskOffering" + random_gen()) - - -class SharedDiskOfferingFactory(DiskOfferingFactory): - - displaytext = "SharedDiskOffering" - name = factory.Sequence(lambda n : "SharedDiskOffering" + random_gen()) - storagetype = "shared" - disksize = 10 #MB - -class LocalDiskOfferingFactory(DiskOfferingFactory): - - displaytext = "LocalDiskOffering" - name = factory.Sequence(lambda n : "LocalDiskOffering" + random_gen()) - storagetype = "local" - disksize = 10 #MB diff --git a/tools/marvin/marvin/factory/DomainFactory.py b/tools/marvin/marvin/factory/DomainFactory.py deleted file mode 100644 index 3924fd35a31..00000000000 --- a/tools/marvin/marvin/factory/DomainFactory.py +++ /dev/null @@ -1,24 +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.base import Domain -from marvin.utils import random_gen -class DomainFactory(factory.Factory): - - FACTORY_FOR = Domain - - name = factory.Sequence(lambda n : "Domain" + random_gen()) diff --git a/tools/marvin/marvin/factory/EgressFirewallRuleFactory.py b/tools/marvin/marvin/factory/EgressFirewallRuleFactory.py deleted file mode 100644 index 7e567452c56..00000000000 --- a/tools/marvin/marvin/factory/EgressFirewallRuleFactory.py +++ /dev/null @@ -1,24 +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.base import EgressFirewallRule -class EgressFirewallRuleFactory(factory.Factory): - - FACTORY_FOR = EgressFirewallRule - - networkid = None - protocol = None diff --git a/tools/marvin/marvin/factory/FirewallRuleFactory.py b/tools/marvin/marvin/factory/FirewallRuleFactory.py deleted file mode 100644 index d833205c876..00000000000 --- a/tools/marvin/marvin/factory/FirewallRuleFactory.py +++ /dev/null @@ -1,38 +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 FirewallRule -from marvin.factory import CloudStackBaseFactory - -class FirewallRuleFactory(CloudStackBaseFactory): - - FACTORY_FOR = FirewallRule.FirewallRule - - ipaddressid = None - protocol = None - -class SshFirewallRuleFactory(FirewallRuleFactory): - protocol = 'tcp' - startport = 22 - endport = 22 - cidrlist = '0.0.0.0/0' - -class HttpFirewallRuleFactory(FirewallRuleFactory): - protocol = 'tcp' - startport = 80 - endport = 80 - cidrlist = '0.0.0.0/0' diff --git a/tools/marvin/marvin/factory/HostFactory.py b/tools/marvin/marvin/factory/HostFactory.py deleted file mode 100644 index abc572dc335..00000000000 --- a/tools/marvin/marvin/factory/HostFactory.py +++ /dev/null @@ -1,27 +0,0 @@ -from marvin.base import Host -from marvin.factory import CloudStackBaseFactory - -class HostFactory(CloudStackBaseFactory): - - FACTORY_FOR = Host - - hypervisor = None - password = None - podid = None - url = None - username = None - zoneid = None - - -class XenserverHostFactory(HostFactory): - - hypervisor = 'XenServer' - password = 'password' - username = 'root' - - -class KvmHostFactory(HostFactory): - - hypervisor = 'KVM' - password = 'password' - username = 'root' diff --git a/tools/marvin/marvin/factory/InstanceGroupFactory.py b/tools/marvin/marvin/factory/InstanceGroupFactory.py deleted file mode 100644 index 376a2a4b56f..00000000000 --- a/tools/marvin/marvin/factory/InstanceGroupFactory.py +++ /dev/null @@ -1,27 +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.base import InstanceGroup -from marvin.factory import CloudStackBaseFactory -from marvin.common import random_gen - - -class InstanceGroupFactory(CloudStackBaseFactory): - - FACTORY_FOR = InstanceGroup.InstanceGroup - - name = factory.Sequence(lambda n : 'instance_group_' + random_gen()) diff --git a/tools/marvin/marvin/factory/IpAddressFactory.py b/tools/marvin/marvin/factory/IpAddressFactory.py deleted file mode 100644 index fedebea037b..00000000000 --- a/tools/marvin/marvin/factory/IpAddressFactory.py +++ /dev/null @@ -1,23 +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.base.IpAddress import IpAddress - - -class IpAddressFactory(factory.Factory): - - FACTORY_FOR = IpAddress diff --git a/tools/marvin/marvin/factory/IpForwardingRuleFactory.py b/tools/marvin/marvin/factory/IpForwardingRuleFactory.py deleted file mode 100644 index 900e2b4a34e..00000000000 --- a/tools/marvin/marvin/factory/IpForwardingRuleFactory.py +++ /dev/null @@ -1,25 +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.base import IpForwardingRule -class IpForwardingRuleFactory(factory.Factory): - - FACTORY_FOR = IpForwardingRule - - ipaddressid = None - protocol = None - startport = None diff --git a/tools/marvin/marvin/factory/IsoFactory.py b/tools/marvin/marvin/factory/IsoFactory.py deleted file mode 100644 index 11f6e5599ae..00000000000 --- a/tools/marvin/marvin/factory/IsoFactory.py +++ /dev/null @@ -1,26 +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.base import Iso -class IsoFactory(factory.Factory): - - FACTORY_FOR = Iso.Iso - - displaytext = None - name = None - url = None - zoneid = None diff --git a/tools/marvin/marvin/factory/LBHealthCheckPolicyFactory.py b/tools/marvin/marvin/factory/LBHealthCheckPolicyFactory.py deleted file mode 100644 index ee8036624a5..00000000000 --- a/tools/marvin/marvin/factory/LBHealthCheckPolicyFactory.py +++ /dev/null @@ -1,26 +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.base import LBHealthCheckPolicy - -class LBHealthCheckPolicyFactory(factory.Factory): - - FACTORY_FOR = LBHealthCheckPolicy.LBHealthCheckPolicy - - lbruleid = None - methodname = None - name = None diff --git a/tools/marvin/marvin/factory/LBStickinessPolicyFactory.py b/tools/marvin/marvin/factory/LBStickinessPolicyFactory.py deleted file mode 100644 index eab0d61ea5c..00000000000 --- a/tools/marvin/marvin/factory/LBStickinessPolicyFactory.py +++ /dev/null @@ -1,25 +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.base import LBStickinessPolicy -class LBStickinessPolicyFactory(factory.Factory): - - FACTORY_FOR = LBStickinessPolicy - - lbruleid = None - methodname = None - name = None diff --git a/tools/marvin/marvin/factory/LoadBalancerRuleFactory.py b/tools/marvin/marvin/factory/LoadBalancerRuleFactory.py deleted file mode 100644 index 84151f3aaaf..00000000000 --- a/tools/marvin/marvin/factory/LoadBalancerRuleFactory.py +++ /dev/null @@ -1,26 +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.base import LoadBalancerRule -class LoadBalancerRuleFactory(factory.Factory): - - FACTORY_FOR = LoadBalancerRule - - algorithm = None - name = None - privateport = None - publicport = None diff --git a/tools/marvin/marvin/factory/NetworkACLFactory.py b/tools/marvin/marvin/factory/NetworkACLFactory.py deleted file mode 100644 index 4b699779954..00000000000 --- a/tools/marvin/marvin/factory/NetworkACLFactory.py +++ /dev/null @@ -1,24 +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.base import NetworkACL -class NetworkACLFactory(factory.Factory): - - FACTORY_FOR = NetworkACL - - networkid = None - protocol = None diff --git a/tools/marvin/marvin/factory/NetworkFactory.py b/tools/marvin/marvin/factory/NetworkFactory.py deleted file mode 100644 index 0144648a18f..00000000000 --- a/tools/marvin/marvin/factory/NetworkFactory.py +++ /dev/null @@ -1,26 +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.base import Network -class NetworkFactory(factory.Factory): - - FACTORY_FOR = Network - - displaytext = None - name = None - networkofferingid = None - zoneid = None diff --git a/tools/marvin/marvin/factory/NetworkOfferingFactory.py b/tools/marvin/marvin/factory/NetworkOfferingFactory.py deleted file mode 100644 index 06d1c180efc..00000000000 --- a/tools/marvin/marvin/factory/NetworkOfferingFactory.py +++ /dev/null @@ -1,83 +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 * -from marvin.base import NetworkOffering -from marvin.utils import random_gen - -class NetworkOfferingFactory(CloudStackBaseFactory): - - FACTORY_FOR = NetworkOffering.NetworkOffering - - displaytext = "Network Offering" - guestiptype = "Isolated" - name = "Network Offering" - supportedservices = "Dhcp,Dns,SourceNat,PortForwarding" - traffictype = "GUEST" - - -class DefaultIsolatedNetworkOfferingWithSourceNatServiceFactory(NetworkOfferingFactory): - #FIXME: Service Capability Lists with CapabilityTypes (ElasticIP, RvR etc) needs handling - - displaytext = factory.Sequence(lambda n : "DefaultIsolatedNetworkOfferingWithSourceNatService" + random_gen()) - name = factory.Sequence(lambda n : "DefaultIsolatedNetworkOfferingWithSourceNatService" + random_gen()) - supportedservices = "Lb,Dns,PortForwarding,StaticNat,Dhcp,Firewall,Vpn,UserData,SourceNat" - traffictype = "GUEST" - availability = "Optional" - guestiptype = "Isolated" - - specifyVlan = False - specifyIpRanges = False - isPersistent = False - conserveMode = True - - serviceProviderList = [] - for service in map(lambda l: l.strip(' '), supportedservices.split(',')): - serviceProviderList.append( - { - 'service': service, - 'provider': 'VirtualRouter' - } - ) - - -class DefaultSharedNetworkOfferingWithSGServiceFactory(NetworkOfferingFactory): - - displaytext = factory.Sequence(lambda n : "DefaultSharedNetworkOfferingWithSGService" + random_gen()) - name = factory.Sequence(lambda n : "DefaultSharedNetworkOfferingWithSGService" + random_gen()) - availability = "Optional" - supportedservices = "SecurityGroup,Dns,Dhcp,UserData" - guestiptype = "Shared" - traffictype = "GUEST" - - specifyVlan = True - specifyIpRanges = True - isPersistent = False - conserveMode = True - - serviceProviderList = [] - for service in map(lambda l: l.strip(' '), supportedservices.split(',')): - if service == 'SecurityGroup': - provider = 'SecurityGroupProvider' - else: - provider = 'VirtualRouter' - serviceProviderList.append( - { - 'service': service, - 'provider': provider - } - ) diff --git a/tools/marvin/marvin/factory/NetworkServiceProviderFactory.py b/tools/marvin/marvin/factory/NetworkServiceProviderFactory.py deleted file mode 100644 index ba85e4b3665..00000000000 --- a/tools/marvin/marvin/factory/NetworkServiceProviderFactory.py +++ /dev/null @@ -1,8 +0,0 @@ -import factory -from marvin.base import NetworkServiceProvider -class NetworkServiceProviderFactory(factory.Factory): - - FACTORY_FOR = NetworkServiceProvider - - name = None - physicalnetworkid = None diff --git a/tools/marvin/marvin/factory/NiciraNvpDeviceFactory.py b/tools/marvin/marvin/factory/NiciraNvpDeviceFactory.py deleted file mode 100644 index 4cc3709a8fa..00000000000 --- a/tools/marvin/marvin/factory/NiciraNvpDeviceFactory.py +++ /dev/null @@ -1,11 +0,0 @@ -import factory -from marvin.base import NiciraNvpDevice -class NiciraNvpDeviceFactory(factory.Factory): - - FACTORY_FOR = NiciraNvpDevice - - hostname = None - password = None - physicalnetworkid = None - transportzoneuuid = None - username = None diff --git a/tools/marvin/marvin/factory/OsCategoriesFactory.py b/tools/marvin/marvin/factory/OsCategoriesFactory.py deleted file mode 100644 index 7ecb7edde19..00000000000 --- a/tools/marvin/marvin/factory/OsCategoriesFactory.py +++ /dev/null @@ -1,5 +0,0 @@ -import factory -from marvin.base import OsCategories -class OsCategoriesFactory(factory.Factory): - - FACTORY_FOR = OsCategories diff --git a/tools/marvin/marvin/factory/OsTypesFactory.py b/tools/marvin/marvin/factory/OsTypesFactory.py deleted file mode 100644 index 6e344baaa46..00000000000 --- a/tools/marvin/marvin/factory/OsTypesFactory.py +++ /dev/null @@ -1,5 +0,0 @@ -import factory -from marvin.base import OsTypes -class OsTypesFactory(factory.Factory): - - FACTORY_FOR = OsTypes diff --git a/tools/marvin/marvin/factory/PhysicalNetworkFactory.py b/tools/marvin/marvin/factory/PhysicalNetworkFactory.py deleted file mode 100644 index 5f104a8631d..00000000000 --- a/tools/marvin/marvin/factory/PhysicalNetworkFactory.py +++ /dev/null @@ -1,24 +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.base import PhysicalNetwork -class PhysicalNetworkFactory(factory.Factory): - - FACTORY_FOR = PhysicalNetwork - - name = None - zoneid = None diff --git a/tools/marvin/marvin/factory/PodFactory.py b/tools/marvin/marvin/factory/PodFactory.py deleted file mode 100644 index 49e350bc326..00000000000 --- a/tools/marvin/marvin/factory/PodFactory.py +++ /dev/null @@ -1,27 +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.base import Pod -class PodFactory(factory.Factory): - - FACTORY_FOR = Pod - - gateway = None - name = None - netmask = None - startip = None - zoneid = None diff --git a/tools/marvin/marvin/factory/PortForwardingRuleFactory.py b/tools/marvin/marvin/factory/PortForwardingRuleFactory.py deleted file mode 100644 index e2339d4862f..00000000000 --- a/tools/marvin/marvin/factory/PortForwardingRuleFactory.py +++ /dev/null @@ -1,27 +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.base import PortForwardingRule -class PortForwardingRuleFactory(factory.Factory): - - FACTORY_FOR = PortForwardingRule - - ipaddressid = None - privateport = None - protocol = None - publicport = None - virtualmachineid = None diff --git a/tools/marvin/marvin/factory/PrivateGatewayFactory.py b/tools/marvin/marvin/factory/PrivateGatewayFactory.py deleted file mode 100644 index ddc6200aca1..00000000000 --- a/tools/marvin/marvin/factory/PrivateGatewayFactory.py +++ /dev/null @@ -1,27 +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.base import PrivateGateway -class PrivateGatewayFactory(factory.Factory): - - FACTORY_FOR = PrivateGateway - - gateway = None - ipaddress = None - netmask = None - vlan = None - vpcid = None diff --git a/tools/marvin/marvin/factory/ProjectFactory.py b/tools/marvin/marvin/factory/ProjectFactory.py deleted file mode 100644 index 4bb5ca99360..00000000000 --- a/tools/marvin/marvin/factory/ProjectFactory.py +++ /dev/null @@ -1,25 +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.base import Project - -class ProjectFactory(factory.Factory): - - FACTORY_FOR = Project - - displaytext = None - name = None diff --git a/tools/marvin/marvin/factory/ProjectInvitationFactory.py b/tools/marvin/marvin/factory/ProjectInvitationFactory.py deleted file mode 100644 index fc43e4aab8d..00000000000 --- a/tools/marvin/marvin/factory/ProjectInvitationFactory.py +++ /dev/null @@ -1,7 +0,0 @@ -import factory -from marvin.base import ProjectInvitation -class ProjectInvitationFactory(factory.Factory): - - FACTORY_FOR = ProjectInvitation - projectid = None - id = None diff --git a/tools/marvin/marvin/factory/RemoteAccessVpnFactory.py b/tools/marvin/marvin/factory/RemoteAccessVpnFactory.py deleted file mode 100644 index c3512291e60..00000000000 --- a/tools/marvin/marvin/factory/RemoteAccessVpnFactory.py +++ /dev/null @@ -1,23 +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.base import RemoteAccessVpn -class RemoteAccessVpnFactory(factory.Factory): - - FACTORY_FOR = RemoteAccessVpn - - publicipid = None diff --git a/tools/marvin/marvin/factory/S3Factory.py b/tools/marvin/marvin/factory/S3Factory.py deleted file mode 100644 index ca2f93fead6..00000000000 --- a/tools/marvin/marvin/factory/S3Factory.py +++ /dev/null @@ -1,8 +0,0 @@ -import factory -from marvin.base import S3 -class S3Factory(factory.Factory): - FACTORY_FOR = S3.S3 - - accesskey = None - bucket = None - secretkey = None diff --git a/tools/marvin/marvin/factory/SSHKeyPairFactory.py b/tools/marvin/marvin/factory/SSHKeyPairFactory.py deleted file mode 100644 index d58084131ee..00000000000 --- a/tools/marvin/marvin/factory/SSHKeyPairFactory.py +++ /dev/null @@ -1,23 +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.base import SSHKeyPair -class SSHKeyPairFactory(factory.Factory): - - FACTORY_FOR = SSHKeyPair - - name = None diff --git a/tools/marvin/marvin/factory/SecondaryStorageFactory.py b/tools/marvin/marvin/factory/SecondaryStorageFactory.py deleted file mode 100644 index c3d972bcc61..00000000000 --- a/tools/marvin/marvin/factory/SecondaryStorageFactory.py +++ /dev/null @@ -1,7 +0,0 @@ -import factory -from marvin.base import SecondaryStorage -class SecondaryStorageFactory(factory.Factory): - - FACTORY_FOR = SecondaryStorage - - url = None diff --git a/tools/marvin/marvin/factory/SecurityGroupFactory.py b/tools/marvin/marvin/factory/SecurityGroupFactory.py deleted file mode 100644 index 2a8c033581c..00000000000 --- a/tools/marvin/marvin/factory/SecurityGroupFactory.py +++ /dev/null @@ -1,23 +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.base import SecurityGroup -class SecurityGroupFactory(factory.Factory): - - FACTORY_FOR = SecurityGroup - - name = None diff --git a/tools/marvin/marvin/factory/ServiceOfferingFactory.py b/tools/marvin/marvin/factory/ServiceOfferingFactory.py deleted file mode 100644 index d44be1e5748..00000000000 --- a/tools/marvin/marvin/factory/ServiceOfferingFactory.py +++ /dev/null @@ -1,38 +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.base import ServiceOffering -from marvin.factory.CloudStackBaseFactory import * -from marvin.utils import random_gen - -class ServiceOfferingFactory(CloudStackBaseFactory): - - FACTORY_FOR = ServiceOffering.ServiceOffering - - cpunumber = 1 - cpuspeed = 1000 #Mhz - displaytext = "Service Offering" - memory = 512 #MB - name = factory.Sequence(lambda n: "ServiceOffering" + random_gen()) - - -class SmallServiceOfferingFactory(ServiceOfferingFactory): - cpunumber = 1 - cpuspeed = 100 #Mhz - memory = 100 #MB - displaytext = "Small Service Offering" - name = factory.Sequence(lambda n: "SmallServiceOffering" + random_gen()) diff --git a/tools/marvin/marvin/factory/SnapshotFactory.py b/tools/marvin/marvin/factory/SnapshotFactory.py deleted file mode 100644 index 5b7641d87a0..00000000000 --- a/tools/marvin/marvin/factory/SnapshotFactory.py +++ /dev/null @@ -1,23 +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.base import Snapshot -class SnapshotFactory(factory.Factory): - - FACTORY_FOR = Snapshot - - volumeid = None diff --git a/tools/marvin/marvin/factory/SnapshotPolicyFactory.py b/tools/marvin/marvin/factory/SnapshotPolicyFactory.py deleted file mode 100644 index f893ad928f0..00000000000 --- a/tools/marvin/marvin/factory/SnapshotPolicyFactory.py +++ /dev/null @@ -1,28 +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.base import SnapshotPolicy - -class SnapshotPolicyFactory(factory.Factory): - - FACTORY_FOR = SnapshotPolicy - - intervaltype = None - maxsnaps = None - schedule = None - timezone = None - volumeid = None diff --git a/tools/marvin/marvin/factory/StaticNatFactory.py b/tools/marvin/marvin/factory/StaticNatFactory.py deleted file mode 100644 index 4ae888728f2..00000000000 --- a/tools/marvin/marvin/factory/StaticNatFactory.py +++ /dev/null @@ -1,8 +0,0 @@ -import factory -from marvin.base import StaticNat -class StaticNatFactory(factory.Factory): - - FACTORY_FOR = StaticNat - - ipaddressid = None - virtualmachineid = None diff --git a/tools/marvin/marvin/factory/StaticRouteFactory.py b/tools/marvin/marvin/factory/StaticRouteFactory.py deleted file mode 100644 index 54f72923c72..00000000000 --- a/tools/marvin/marvin/factory/StaticRouteFactory.py +++ /dev/null @@ -1,24 +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.base import StaticRoute -class StaticRouteFactory(factory.Factory): - - FACTORY_FOR = StaticRoute - - cidr = None - gatewayid = None diff --git a/tools/marvin/marvin/factory/StorageNetworkIpRangeFactory.py b/tools/marvin/marvin/factory/StorageNetworkIpRangeFactory.py deleted file mode 100644 index c73b0893759..00000000000 --- a/tools/marvin/marvin/factory/StorageNetworkIpRangeFactory.py +++ /dev/null @@ -1,27 +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.base import StorageNetworkIpRange - -class StorageNetworkIpRangeFactory(factory.Factory): - - FACTORY_FOR = StorageNetworkIpRange - - gateway = None - netmask = None - podid = None - startip = None diff --git a/tools/marvin/marvin/factory/StoragePoolFactory.py b/tools/marvin/marvin/factory/StoragePoolFactory.py deleted file mode 100644 index 9279c897acf..00000000000 --- a/tools/marvin/marvin/factory/StoragePoolFactory.py +++ /dev/null @@ -1,27 +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.base import StoragePool - -class StoragePoolFactory(factory.Factory): - - FACTORY_FOR = StoragePool - - clusterid = None - name = None - podid = None - url = None diff --git a/tools/marvin/marvin/factory/TagsFactory.py b/tools/marvin/marvin/factory/TagsFactory.py deleted file mode 100644 index 18a32fe7f8f..00000000000 --- a/tools/marvin/marvin/factory/TagsFactory.py +++ /dev/null @@ -1,25 +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.base import Tags -class TagsFactory(factory.Factory): - - FACTORY_FOR = Tags - - resourceids = None - resourcetype = None - tags = None diff --git a/tools/marvin/marvin/factory/TemplateFactory.py b/tools/marvin/marvin/factory/TemplateFactory.py deleted file mode 100644 index 6d71277920a..00000000000 --- a/tools/marvin/marvin/factory/TemplateFactory.py +++ /dev/null @@ -1,37 +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 Template -from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory - -class TemplateFactory(CloudStackBaseFactory): - - FACTORY_FOR = Template.Template - - name = None - displaytext = None - format = None - url = None - hypervisor = None - zoneid = None - ostypeid = None - -class DefaultBuiltInTemplateFactory(TemplateFactory): - ostype = 'CentOS 5.3 (64-bit)' - displaytext = 'CentOS 5.3 (64-bit)' - name = 'CentOS 5.3 (64-bit)' - format = 'VHD' - hypervisor = 'XenServer' diff --git a/tools/marvin/marvin/factory/TrafficMonitorFactory.py b/tools/marvin/marvin/factory/TrafficMonitorFactory.py deleted file mode 100644 index 804a0f84448..00000000000 --- a/tools/marvin/marvin/factory/TrafficMonitorFactory.py +++ /dev/null @@ -1,8 +0,0 @@ -import factory -from marvin.base import TrafficMonitor -class TrafficMonitorFactory(factory.Factory): - - FACTORY_FOR = TrafficMonitor - - url = None - zoneid = None diff --git a/tools/marvin/marvin/factory/TrafficTypeFactory.py b/tools/marvin/marvin/factory/TrafficTypeFactory.py deleted file mode 100644 index 87fe929491e..00000000000 --- a/tools/marvin/marvin/factory/TrafficTypeFactory.py +++ /dev/null @@ -1,9 +0,0 @@ -import factory -from marvin.base import TrafficType -class TrafficTypeFactory(factory.Factory): - - FACTORY_FOR = TrafficType - - physicalnetworkid = None - traffictype = None - id = None diff --git a/tools/marvin/marvin/factory/UsageRecordsFactory.py b/tools/marvin/marvin/factory/UsageRecordsFactory.py deleted file mode 100644 index 36c4ecdf446..00000000000 --- a/tools/marvin/marvin/factory/UsageRecordsFactory.py +++ /dev/null @@ -1,8 +0,0 @@ -import factory -from marvin.base import UsageRecords -class UsageRecordsFactory(factory.Factory): - - FACTORY_FOR = UsageRecords - - enddate = None - startdate = None diff --git a/tools/marvin/marvin/factory/UserFactory.py b/tools/marvin/marvin/factory/UserFactory.py deleted file mode 100644 index 4981ca4ff0d..00000000000 --- a/tools/marvin/marvin/factory/UserFactory.py +++ /dev/null @@ -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. -import factory -from marvin.base import User -from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory -from marvin.factory.AccountFactory import AccountFactory - -class UserFactory(CloudStackBaseFactory): - - FACTORY_FOR = User.User - - account = factory.SubFactory(AccountFactory, apiclient=factory.SelfAttribute('..apiclient')) - email = factory.SelfAttribute('account.email') - firstname = factory.SelfAttribute('account.firstname') - lastname = factory.SelfAttribute('account.lastname') - password = factory.SelfAttribute('account.password') - username = factory.SelfAttribute('account.name') - -class AdminUserFactory(UserFactory): - account = factory.SubFactory(AccountFactory, accounttype=1) diff --git a/tools/marvin/marvin/factory/VMSnapshotFactory.py b/tools/marvin/marvin/factory/VMSnapshotFactory.py deleted file mode 100644 index fa3dcc969cd..00000000000 --- a/tools/marvin/marvin/factory/VMSnapshotFactory.py +++ /dev/null @@ -1,23 +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.base import VMSnapshot -class VMSnapshotFactory(factory.Factory): - - FACTORY_FOR = VMSnapshot.VMSnapshot - - virtualmachineid = None diff --git a/tools/marvin/marvin/factory/VPCFactory.py b/tools/marvin/marvin/factory/VPCFactory.py deleted file mode 100644 index e7f46a7be37..00000000000 --- a/tools/marvin/marvin/factory/VPCFactory.py +++ /dev/null @@ -1,27 +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.base import VPC -class VPCFactory(factory.Factory): - - FACTORY_FOR = VPC - - cidr = None - displaytext = None - name = None - vpcofferingid = None - zoneid = None diff --git a/tools/marvin/marvin/factory/VPCOfferingFactory.py b/tools/marvin/marvin/factory/VPCOfferingFactory.py deleted file mode 100644 index a2a51d200c9..00000000000 --- a/tools/marvin/marvin/factory/VPCOfferingFactory.py +++ /dev/null @@ -1,25 +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.base import VPCOffering -class VPCOfferingFactory(factory.Factory): - - FACTORY_FOR = VPCOffering - - displaytext = None - name = None - supportedservices = None diff --git a/tools/marvin/marvin/factory/VirtualMachineFactory.py b/tools/marvin/marvin/factory/VirtualMachineFactory.py deleted file mode 100644 index 6c6e44ed1cd..00000000000 --- a/tools/marvin/marvin/factory/VirtualMachineFactory.py +++ /dev/null @@ -1,27 +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.VirtualMachine import VirtualMachine -from marvin.factory.CloudStackBaseFactory import CloudStackBaseFactory - -class VirtualMachineFactory(CloudStackBaseFactory): - - FACTORY_FOR = VirtualMachine - - serviceofferingid = None - templateid = None - zoneid = None diff --git a/tools/marvin/marvin/factory/VirtualRouterElementFactory.py b/tools/marvin/marvin/factory/VirtualRouterElementFactory.py deleted file mode 100644 index fc1fd7d2096..00000000000 --- a/tools/marvin/marvin/factory/VirtualRouterElementFactory.py +++ /dev/null @@ -1,24 +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.base import VirtualRouterElement - -class VirtualRouterElementFactory(factory.Factory): - - FACTORY_FOR = VirtualRouterElement - - nspid = None diff --git a/tools/marvin/marvin/factory/VlanIpRangeFactory.py b/tools/marvin/marvin/factory/VlanIpRangeFactory.py deleted file mode 100644 index 4301edbec15..00000000000 --- a/tools/marvin/marvin/factory/VlanIpRangeFactory.py +++ /dev/null @@ -1,23 +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.base import VlanIpRange -class VlanIpRangeFactory(factory.Factory): - - FACTORY_FOR = VlanIpRange - - startip = None diff --git a/tools/marvin/marvin/factory/VolumeFactory.py b/tools/marvin/marvin/factory/VolumeFactory.py deleted file mode 100644 index fa270847d51..00000000000 --- a/tools/marvin/marvin/factory/VolumeFactory.py +++ /dev/null @@ -1,23 +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.base import Volume -class VolumeFactory(factory.Factory): - - FACTORY_FOR = Volume - - name = None diff --git a/tools/marvin/marvin/factory/VpnConnectionFactory.py b/tools/marvin/marvin/factory/VpnConnectionFactory.py deleted file mode 100644 index 2f6676d32de..00000000000 --- a/tools/marvin/marvin/factory/VpnConnectionFactory.py +++ /dev/null @@ -1,24 +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.base import VpnConnection -class VpnConnectionFactory(factory.Factory): - - FACTORY_FOR = VpnConnection - - s2scustomergatewayid = None - s2svpngatewayid = None diff --git a/tools/marvin/marvin/factory/VpnCustomerGatewayFactory.py b/tools/marvin/marvin/factory/VpnCustomerGatewayFactory.py deleted file mode 100644 index be1675f6539..00000000000 --- a/tools/marvin/marvin/factory/VpnCustomerGatewayFactory.py +++ /dev/null @@ -1,27 +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.base import VpnCustomerGateway -class VpnCustomerGatewayFactory(factory.Factory): - - FACTORY_FOR = VpnCustomerGateway - - cidrlist = None - esppolicy = None - gateway = None - ikepolicy = None - ipsecpsk = None diff --git a/tools/marvin/marvin/factory/VpnGatewayFactory.py b/tools/marvin/marvin/factory/VpnGatewayFactory.py deleted file mode 100644 index 2f2642da46e..00000000000 --- a/tools/marvin/marvin/factory/VpnGatewayFactory.py +++ /dev/null @@ -1,23 +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.base import VpnGateway -class VpnGatewayFactory(factory.Factory): - - FACTORY_FOR = VpnGateway - - vpcid = None diff --git a/tools/marvin/marvin/factory/VpnUserFactory.py b/tools/marvin/marvin/factory/VpnUserFactory.py deleted file mode 100644 index 86982c75e6e..00000000000 --- a/tools/marvin/marvin/factory/VpnUserFactory.py +++ /dev/null @@ -1,25 +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.base import VpnUser - -class VpnUserFactory(factory.Factory): - - FACTORY_FOR = VpnUser.VpnUser - - password = "password" - username = "vpnuser" diff --git a/tools/marvin/marvin/factory/ZoneFactory.py b/tools/marvin/marvin/factory/ZoneFactory.py deleted file mode 100644 index bc32e16f80a..00000000000 --- a/tools/marvin/marvin/factory/ZoneFactory.py +++ /dev/null @@ -1,37 +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.base import Zone -from marvin.factory import CloudStackBaseFactory -from marvin.utils import random_gen - -class ZoneFactory(CloudStackBaseFactory): - - FACTORY_FOR = Zone.Zone - - dns1 = "8.8.8.8" - internaldns1 = "8.8.8.8" - name = None - networktype = None - -class AdvancedZoneFactory(ZoneFactory): - name = factory.Sequence(lambda n: "advzone" + random_gen()) - networktype = "Advanced" - -class BasicZoneFactory(ZoneFactory): - name = factory.Sequence(lambda n: "basiczone" + random_gen()) - networktype = "Basic" diff --git a/tools/marvin/marvin/factory/test/__init__.py b/tools/marvin/marvin/factory/test/__init__.py deleted file mode 100644 index d216be4ddc9..00000000000 --- a/tools/marvin/marvin/factory/test/__init__.py +++ /dev/null @@ -1,16 +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. \ No newline at end of file diff --git a/tools/marvin/marvin/factory/test/testFactories.py b/tools/marvin/marvin/factory/test/testFactories.py deleted file mode 100644 index c798bb4ccb0..00000000000 --- a/tools/marvin/marvin/factory/test/testFactories.py +++ /dev/null @@ -1,191 +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 unittest -import logging - -from marvin.cloudstackTestClient import cloudstackTestClient - -from marvin.factory.AccountFactory import * -from marvin.factory.ServiceOfferingFactory import * -from marvin.factory.NetworkOfferingFactory import * -from marvin.factory.TemplateFactory import * -from marvin.factory.VirtualMachineFactory import * -from marvin.factory.UserFactory import * - - -from marvin.base.ServiceOffering import ServiceOffering -from marvin.base.Zone import Zone -from marvin.base.Account import Account -from marvin.base.Template import Template -from marvin.base.IpAddress import IpAddress -from marvin.base.Network import Network - - - - -class BuildVsCreateStrategyTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_buildAccountFactory(self): - af = AccountFactory() - self.assert_(af.username is not None, msg="Acount factory didn't initialize") - - def test_createAccountFactory(self): - af = AccountFactory.create(apiclient=self.apiClient) - self.assert_(isinstance(af, Account)) - self.assert_(af.account.id is not None, msg="Account creation failed") - self.assert_(af.account.domain is not None, msg="Account belongs to no domain") - - -class AccountFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def test_adminAccountFactory(self): - accnt = AdminAccountFactory.create(apiclient=self.apiClient) - self.assert_(accnt is not None, msg="no account created by factory") - self.assert_(accnt.account.name is not None) - - def test_userAccountFactoryCustomArgs(self): - accnt = AccountFactory.create(apiclient=self.apiClient, firstname='test', lastname='test') - a = accnt.list(apiclient=self.apiClient, account=accnt.account.username, domainid=accnt.account.domainid) - self.assert_(accnt is not None, msg="no account created by factory") - self.assert_(accnt.account.name is not None) - - @unittest.skip("Account doesn't deserialize correctly") - def test_disableAccountPostFactoryGeneration(self): - domadmin = DomainAdminFactory.create(apiclient=self.apiClient) - self.assert_(domadmin is not None, msg="no account was created") - domadmin.disable(self.apiClient, lock=True) - - def tearDown(self): - pass - - -class ServiceOfferingFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def test_serviceOfferingFactory(self): - soffering = ServiceOfferingFactory.create(apiclient=self.apiClient) - self.assert_(soffering is not None, msg="no service offering was created") - self.assert_(soffering.name is not None, msg="error in service offering factory creation") - - - def tearDown(self): - pass - - -class NetworkOfferingFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def test_defaultSourceNatOfferingFactory(self): - snatOffering = DefaultIsolatedNetworkOfferingWithSourceNatServiceFactory.create(apiclient=self.apiClient) - self.assert_(snatOffering is not None, msg = "no network offering was created") - self.assert_(snatOffering.name is not None, msg="error in network offering creation") - - def test_defaultSGOfferingEnable(self): - sgOffering = DefaultSharedNetworkOfferingWithSGServiceFactory.create(apiclient=self.apiClient) - sgOffering.update(self.apiClient, state='Enabled') - - def tearDown(self): - pass - - -class VirtualMachineFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_virtualMachineDeploy(self): - accnt = AccountFactory.create(apiclient=self.apiClient) - service = SmallServiceOfferingFactory.create(apiclient=self.apiClient) - tf = DefaultBuiltInTemplateFactory.build() #FIXME: Using build() strategy is confusing - zones = Zone.list(apiclient=self.apiClient) - template = Template.list(apiclient=self.apiClient, - templatefilter="featured", - ostype = tf.ostype, - zoneid = zones[0].id) - vm = VirtualMachineFactory.create(apiclient=self.apiClient, - serviceofferingid = service.id, - templateid = template[0].id, - zoneid = zones[0].id, - account = accnt.account.name, - domainid = accnt.account.domainid) - vm.destroy(apiclient=self.apiClient) - - - -class UserFactorySubFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_userSubFactory(self): - uf = UserFactory.create(apiclient=self.apiClient) - user = User.list(apiclient=self.apiClient, username=uf.account.username) - self.assert_(uf.username == user[0].username, msg="Usernames don't match") - - -class IpAddressFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_associateIpAddress(self): - all_ips = IpAddress.list(apiclient=self.apiClient) - self.assert_(len(all_ips) > 0, msg="No free public IPs") - firstip = all_ips[0] - firstip.associate(apiclient=self.apiClient, zoneid=firstip.zoneid) - - def test_vpcAssociateIpAddress(self): - #FIXME: To be written - self.assert_(1 == 1) - - def test_associateIpAddressToNetwork(self): - accnt = AccountFactory.create(apiclient=self.apiClient) - self.assert_(accnt is not None) - self.assert_(isinstance(accnt, Account)) - service = ServiceOffering.list(apiclient=self.apiClient, displaytext='Small') - self.assert_(len(service) > 0) - template = Template.list(apiclient=self.apiClient, templatefilter="featured") - self.assert_(len(template) > 0) - zones = Zone.list(apiclient=self.apiClient) - vm = VirtualMachineFactory.create( - apiclient=self.apiClient, - serviceofferingid = service[0].id, - templateid = template[0].id, - zoneid = zones[0].id, - account=accnt.account.name, - domainid=accnt.account.domainid) - all_ips = IpAddress.list(apiclient=self.apiClient) - firstip = all_ips[0] - networks = Network.list(apiclient=self.apiClient, account = accnt.account.name, domainid = accnt.account.domainid) - firstip.associate(apiclient=self.apiClient, networkid = networks[0].id) - vm.destroy(apiclient=self.apiClient) \ No newline at end of file diff --git a/tools/marvin/marvin/factory/test/test_factories.py b/tools/marvin/marvin/factory/test/test_factories.py deleted file mode 100644 index 56903ff8181..00000000000 --- a/tools/marvin/marvin/factory/test/test_factories.py +++ /dev/null @@ -1,187 +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 unittest -import logging - -from marvin.cloudstackTestClient import cloudstackTestClient - -from marvin.factory.AccountFactory import * -from marvin.factory.ServiceOfferingFactory import * -from marvin.factory.NetworkOfferingFactory import * -from marvin.factory.TemplateFactory import * -from marvin.factory.VirtualMachineFactory import * -from marvin.factory.UserFactory import * - -from marvin.base.ServiceOffering import ServiceOffering -from marvin.base.Zone import Zone -from marvin.base.Account import Account -from marvin.base.Template import Template -from marvin.base.IpAddress import IpAddress -from marvin.base.Network import Network - -class BuildVsCreateStrategyTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_buildUserAccountFactory(self): - af = UserAccountFactory() - self.assert_(af.account is not None, msg="Acount factory didn't initialize") - - def test_createAccountFactory(self): - af = AccountFactory.create(apiclient=self.apiClient) - self.assert_(isinstance(af, Account)) - self.assert_(af.account.id is not None, msg="Account creation failed") - self.assert_(af.account.domain is not None, msg="Account belongs to no domain") - - -class AccountFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def test_adminAccountFactory(self): - accnt = AdminAccountFactory.create(apiclient=self.apiClient) - self.assert_(accnt is not None, msg="no account created by factory") - self.assert_(accnt.account.name is not None) - - def test_userAccountFactoryCustomArgs(self): - accnt = UserAccountFactory.create(apiclient=self.apiClient, firstname='test', lastname='test') - a = accnt.list(apiclient=self.apiClient, account=accnt.account.username, domainid=accnt.account.domainid) - self.assert_(accnt is not None, msg="no account created by factory") - self.assert_(accnt.account.name is not None) - - @unittest.skip("Account doesn't deserialize correctly") - def test_disableAccountPostFactoryGeneration(self): - domadmin = DomainAdminFactory.create(apiclient=self.apiClient) - self.assert_(domadmin is not None, msg="no account was created") - domadmin.disable(self.apiClient, lock=True) - - def tearDown(self): - pass - - -class ServiceOfferingFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def test_serviceOfferingFactory(self): - soffering = ServiceOfferingFactory.create(apiclient=self.apiClient) - self.assert_(soffering is not None, msg="no service offering was created") - self.assert_(soffering.name is not None, msg="error in service offering factory creation") - - - def tearDown(self): - pass - - -class NetworkOfferingFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def test_defaultSourceNatOfferingFactory(self): - snatOffering = DefaultIsolatedNetworkOfferingWithSourceNatServiceFactory.create(apiclient=self.apiClient) - self.assert_(snatOffering is not None, msg = "no network offering was created") - self.assert_(snatOffering.name is not None, msg="error in network offering creation") - - def test_defaultSGOfferingEnable(self): - sgOffering = DefaultSharedNetworkOfferingWithSGServiceFactory.create(apiclient=self.apiClient) - sgOffering.update(self.apiClient, state='Enabled') - - def tearDown(self): - pass - - -class VirtualMachineFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_virtualMachineDeploy(self): - accnt = AccountFactory.create(apiclient=self.apiClient) - service = SmallServiceOfferingFactory.create(apiclient=self.apiClient) - tf = DefaultBuiltInTemplateFactory.build() #FIXME: Using build() strategy is confusing - zones = Zone.list(apiclient=self.apiClient) - template = Template.list(apiclient=self.apiClient, - templatefilter="featured", - ostype = tf.ostype, - zoneid = zones[0].id) - vm = VirtualMachineFactory.create(apiclient=self.apiClient, - serviceofferingid = service.id, - templateid = template[0].id, - zoneid = zones[0].id, - account = accnt.account.name, - domainid = accnt.account.domainid) - vm.destroy(apiclient=self.apiClient) - - - -class UserFactorySubFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_userSubFactory(self): - uf = UserFactory.create(apiclient=self.apiClient) - user = User.list(apiclient=self.apiClient, username=uf.username) - self.assert_(uf.username == user[0].username, msg="Usernames don't match") - - -class IpAddressFactoryTest(unittest.TestCase): - def setUp(self): - self.apiClient = cloudstackTestClient(mgtSvr='localhost', logging=logging.getLogger('factories.cloudstack')).getApiClient() - - def tearDown(self): - pass - - def test_associateIpAddress(self): - all_ips = IpAddress.list(apiclient=self.apiClient) - self.assert_(len(all_ips) > 0, msg="No free public IPs") - firstip = all_ips[0] - firstip.associate(apiclient=self.apiClient, zoneid=firstip.zoneid) - - def test_vpcAssociateIpAddress(self): - #FIXME: To be written - self.assert_(1 == 1) - - def test_associateIpAddressToNetwork(self): - accnt = AccountFactory.create(apiclient=self.apiClient) - self.assert_(accnt is not None) - self.assert_(isinstance(accnt, Account)) - service = ServiceOffering.list(apiclient=self.apiClient, displaytext='Small') - self.assert_(len(service) > 0) - template = Template.list(apiclient=self.apiClient, templatefilter="featured") - self.assert_(len(template) > 0) - zones = Zone.list(apiclient=self.apiClient) - vm = VirtualMachineFactory.create( - apiclient=self.apiClient, - serviceofferingid = service[0].id, - templateid = template[0].id, - zoneid = zones[0].id, - account=accnt.account.name, - domainid=accnt.account.domainid) - all_ips = IpAddress.list(apiclient=self.apiClient) - firstip = all_ips[0] - networks = Network.list(apiclient=self.apiClient, account = accnt.account.name, domainid = accnt.account.domainid) - firstip.associate(apiclient=self.apiClient, networkid = networks[0].id) - vm.destroy(apiclient=self.apiClient) \ No newline at end of file